diff --git a/OUDS/Core/Tokens/RawTokens/Sources/BorderRawTokens.swift b/OUDS/Core/Tokens/RawTokens/Sources/BorderRawTokens.swift index b2b3f687b0..5b3940639e 100644 --- a/OUDS/Core/Tokens/RawTokens/Sources/BorderRawTokens.swift +++ b/OUDS/Core/Tokens/RawTokens/Sources/BorderRawTokens.swift @@ -23,16 +23,18 @@ public typealias BorderRadiusRawToken = Double /// Typealise for `String` so as to help users (developers) to see that raw tokens are needed and linked to `String` for **border style raw tokeb**. /// `String` are used here to prevent to rely on _SwiftUI_ types which are not compatible with `@objc` and are heavier than primitive types. -/// In addition, if new styles are defined in design team side (such as kind of composite styles) and need to be processed differently (because not available with _SwiftUI_ because are composed of several styles), -/// such `String` values could be procesed later without nay API breaks. +/// In addition, if new styles are defined in design team side (such as kind of composite styles) and need to be processed differently +/// (because not available with _SwiftUI_ because are composed of several styles), +/// such `String` values could be procesed later without any API breaks. public typealias BorderStyleRawToken = String // MARK: - Raw tokens /// This is the group of all **raw tokens** related to **borders**. /// Primitive types such as `Double` and `String` must be used to as to allow to use `@objc` keywords in _Swift extensions_ for overriding. -/// Such tokens are packed in a _Swift struct_ so as to gather them in one object and avoid to have just constants in nothing else (i.e. publicly accessible from everywhere) or _Swift enum_ whch are too heavy -/// (no needs to iterate on them, no needs to make switch/cases, riskjs to have broken code if new values added breaking existing switch/cases). +/// Such tokens are packed in a _Swift struct_ so as to gather them in one object and avoid to have just constants in nothing else +/// (i.e. publicly accessible from everywhere) or _Swift enum_ which are too heavy (no needs to iterate on them, no needs to make switch/cases, +/// risks to have broken code if new values added breaking existing switch/cases). /// /// In the future, generating tools like _Style Dictionary_ should either follow this file template and structure or just replace values or lines. public struct BorderRawTokens { @@ -66,7 +68,7 @@ public struct BorderRawTokens { public static let borderRadius9999: BorderRadiusRawToken = 2000 // MARK: Primitive token - Border - Style - + public static let borderStyleNone: BorderStyleRawToken = "none" public static let borderStyleSolid: BorderStyleRawToken = "solid" public static let borderStyleDashed: BorderStyleRawToken = "dashed" diff --git a/OUDS/Core/Tokens/RawTokens/Tests/BorderRawTokensTests.swift b/OUDS/Core/Tokens/RawTokens/Tests/BorderRawTokensTests.swift index b361c778cf..1e4095eacc 100644 --- a/OUDS/Core/Tokens/RawTokens/Tests/BorderRawTokensTests.swift +++ b/OUDS/Core/Tokens/RawTokens/Tests/BorderRawTokensTests.swift @@ -30,7 +30,7 @@ final class BorderRawTokensTests: XCTestCase { XCTAssertLessThan(BorderRawTokens.borderWidth100, BorderRawTokens.borderWidth150) XCTAssertLessThan(BorderRawTokens.borderWidth150, BorderRawTokens.borderWidth200) } - + /// Wathever the values are, border radius raw tokens must keep their order relationships func testOrderRelationshipForRadius() throws { XCTAssertLessThan(BorderRawTokens.borderRadius0, BorderRawTokens.borderRadius25) @@ -46,7 +46,7 @@ final class BorderRawTokensTests: XCTestCase { XCTAssertLessThan(BorderRawTokens.borderRadius600, BorderRawTokens.borderRadius800) XCTAssertLessThan(BorderRawTokens.borderRadius800, BorderRawTokens.borderRadius9999) } - + /// Border styles raw tokens should be different func testNonEqualityForStyles() throws { XCTAssertNotEqual(BorderRawTokens.borderStyleNone, BorderRawTokens.borderStyleSolid)