- Convert XCTestCase classes to structs with @Test functions - Replace XCTAssert* with #expect, and force unwraps/XCTFail with #require - Resolve test bundle via a class token in the CLI smoke test (Swift Testing does not register the .xctest bundle in Bundle.allBundles) - Rename adaptForXCTest() to adaptForTest()
37 lines
999 B
Swift
37 lines
999 B
Swift
//
|
|
// FontPlistGeneratorTests.swift
|
|
//
|
|
//
|
|
// Created by Thibaut Schmitt on 05/09/2022.
|
|
//
|
|
|
|
import Foundation
|
|
import Testing
|
|
|
|
@testable import ResgenSwift
|
|
|
|
struct FontPlistGeneratorTests {
|
|
@Test
|
|
func generatedPlist() {
|
|
// Given
|
|
let fontNames: [FontName] = [
|
|
FontName(postscriptName: "CircularStd-Regular", filename: "CircularStd-Regular", fileExtension: "ttf"),
|
|
FontName(postscriptName: "CircularStd-Bold", filename: "CircularStd-Bold", fileExtension: "ttf")
|
|
]
|
|
|
|
// When
|
|
let plistContent = FontPlistGenerator.generatePlistUIAppsFontContent(for: fontNames, infoPlistPaths: [String]())
|
|
|
|
// Expect
|
|
let expect = """
|
|
<key>UIAppFonts</key>
|
|
<array>
|
|
<string>CircularStd-Regular.ttf</string>
|
|
<string>CircularStd-Bold.ttf</string>
|
|
</array>
|
|
"""
|
|
|
|
#expect(plistContent.adaptForTest() == expect.adaptForTest())
|
|
}
|
|
}
|