[Test] fix MathFontTests on mac

This commit is contained in:
Nicolas Guillot
2025-10-01 10:36:11 +02:00
parent fe00c5a96e
commit b67cc8fd38
2 changed files with 21 additions and 4 deletions

4
Tests/SwiftMathTests/MathFontTests.swift Executable file → Normal file
View File

@@ -17,7 +17,7 @@ final class MathFontTests: XCTestCase {
XCTAssertNotNil($0.cgFont())
XCTAssertNotNil($0.ctFont(withSize: CGFloat(size)))
XCTAssertEqual($0.ctFont(withSize: CGFloat(size)).fontSize, CGFloat(size), "ctFont fontSize != size.")
XCTAssertEqual($0.cgFont().postScriptName as? String, $0.fontName, "postscript Name != UIFont fontName")
XCTAssertEqual($0.cgFont().postScriptName as? String, $0.postScriptName, "cgFont.postScriptName != postScriptName")
// XCTAssertEqual($0.uiFont(withSize: CGFloat(size))?.familyName, $0.fontFamilyName, "uifont familyName != familyName.")
XCTAssertEqual(CTFontCopyFamilyName($0.ctFont(withSize: CGFloat(size))) as String, $0.fontFamilyName, "ctfont.family != familyName")
}
@@ -48,7 +48,7 @@ final class MathFontTests: XCTestCase {
XCTAssertEqual(mathFont.ctFont(withSize: CGFloat(size)).fontSize, CGFloat(size), "ctFont fontSize test")
}
var fontNames: [String] {
MathFont.allCases.map { $0.fontName }
MathFont.allCases.map { $0.postScriptName }
}
var fontFamilyNames: [String] {
MathFont.allCases.map { $0.fontFamilyName }