resgen.swift/Tests/ResgenSwiftTests/Fonts/FontPlistGeneratorTests.swift
Thibaut Schmitt 756de4f1de
All checks were successful
gitea-openium/resgen.swift/pipeline/head This commit looks good
feat(RES-34): Fix plist font filename (#14)
Reviewed-on: #14
2025-05-05 09:53:05 +02:00

36 lines
1018 B
Swift

//
// FontPlistGeneratorTests.swift
//
//
// Created by Thibaut Schmitt on 05/09/2022.
//
import Foundation
import XCTest
@testable import ResgenSwift
final class FontPlistGeneratorTests: XCTestCase {
func testGeneratedPlist() {
// 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>
"""
XCTAssertEqual(plistContent.adaptForXCTest(), expect.adaptForXCTest())
}
}