@@ -27,24 +27,24 @@ final class TypographySFProTests: XCTestCase {
2727 }
2828
2929 func testSFProDisplay( ) {
30- _testFontFamily ( Typography . sfProDisplay)
30+ _testFontFamily ( Typography . sfProDisplay, style : . regular )
3131 }
3232
3333 func testSFProDisplayItalic( ) {
34- _testFontFamily ( Typography . sfProDisplayItalic, isItalic : true )
34+ _testFontFamily ( Typography . sfProDisplayItalic, style : . italic )
3535 }
3636
3737 func testSFProText( ) {
38- _testFontFamily ( Typography . sfProText)
38+ _testFontFamily ( Typography . sfProText, style : . regular )
3939 }
4040
4141 func testSFProTextItalic( ) {
42- _testFontFamily ( Typography . sfProTextItalic, isItalic : true )
42+ _testFontFamily ( Typography . sfProTextItalic, style : . italic )
4343 }
4444}
4545
4646private extension TypographySFProTests {
47- func _testFontFamily( _ fontFamily: FontRepresentable , isItalic : Bool = false ) {
47+ func _testFontFamily( _ fontFamily: FontRepresentable , style : Typography . FontStyle ) {
4848 Typography . FontWeight. allCases. forEach {
4949 let typography = Typography (
5050 fontFamily: fontFamily,
@@ -54,12 +54,12 @@ private extension TypographySFProTests {
5454 textStyle: . callout
5555 )
5656
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)
5959 }
6060 }
6161
62- func _testTypography( _ typography: Typography , isItalic : Bool , traits: UITraitCollection ? ) {
62+ func _testTypography( _ typography: Typography , style : Typography . FontStyle , traits: UITraitCollection ? ) {
6363 let layout = typography. generateLayout ( compatibleWith: traits)
6464
6565 // we expect a font
@@ -73,7 +73,7 @@ private extension TypographySFProTests {
7373
7474 // we expect the font to be italic or not
7575 let fontName = layout. font. fontName
76- if isItalic {
76+ if style == . italic {
7777 XCTAssertTrue ( fontName. hasSuffix ( FontInfo . italicSuffix) )
7878 } else {
7979 XCTAssertFalse ( fontName. hasSuffix ( FontInfo . italicSuffix) )
0 commit comments