@@ -27,24 +27,24 @@ final class TypographySFProTests: XCTestCase {
27
27
}
28
28
29
29
func testSFProDisplay( ) {
30
- _testFontFamily ( Typography . sfProDisplay)
30
+ _testFontFamily ( Typography . sfProDisplay, style : . regular )
31
31
}
32
32
33
33
func testSFProDisplayItalic( ) {
34
- _testFontFamily ( Typography . sfProDisplayItalic, isItalic : true )
34
+ _testFontFamily ( Typography . sfProDisplayItalic, style : . italic )
35
35
}
36
36
37
37
func testSFProText( ) {
38
- _testFontFamily ( Typography . sfProText)
38
+ _testFontFamily ( Typography . sfProText, style : . regular )
39
39
}
40
40
41
41
func testSFProTextItalic( ) {
42
- _testFontFamily ( Typography . sfProTextItalic, isItalic : true )
42
+ _testFontFamily ( Typography . sfProTextItalic, style : . italic )
43
43
}
44
44
}
45
45
46
46
private extension TypographySFProTests {
47
- func _testFontFamily( _ fontFamily: FontRepresentable , isItalic : Bool = false ) {
47
+ func _testFontFamily( _ fontFamily: FontRepresentable , style : Typography . FontStyle ) {
48
48
Typography . FontWeight. allCases. forEach {
49
49
let typography = Typography (
50
50
fontFamily: fontFamily,
@@ -54,12 +54,12 @@ private extension TypographySFProTests {
54
54
textStyle: . callout
55
55
)
56
56
57
- _testTypography ( typography, isItalic : isItalic , traits: nil )
58
- _testTypography ( typography, isItalic : isItalic , traits: boldTraits)
57
+ _testTypography ( typography, style : style , traits: nil )
58
+ _testTypography ( typography, style : style , traits: boldTraits)
59
59
}
60
60
}
61
61
62
- func _testTypography( _ typography: Typography , isItalic : Bool , traits: UITraitCollection ? ) {
62
+ func _testTypography( _ typography: Typography , style : Typography . FontStyle , traits: UITraitCollection ? ) {
63
63
let layout = typography. generateLayout ( compatibleWith: traits)
64
64
65
65
// we expect a font
@@ -73,7 +73,7 @@ private extension TypographySFProTests {
73
73
74
74
// we expect the font to be italic or not
75
75
let fontName = layout. font. fontName
76
- if isItalic {
76
+ if style == . italic {
77
77
XCTAssertTrue ( fontName. hasSuffix ( FontInfo . italicSuffix) )
78
78
} else {
79
79
XCTAssertFalse ( fontName. hasSuffix ( FontInfo . italicSuffix) )
0 commit comments