Slice 2 (Phase 1a) of the M9 Monterey retarget. Converts all pure Core suites (argv builders, CGATS/CUPS/profcheck/gamut-mesh parsers, colour math, file/artefact helpers, classifiers) to XCTestCase, and adds the shared assertAsyncThrows helper for the async-throws sites that Slice 3 will convert. Deferred to Slice 3 (kept on Swift Testing in mixed files): ProcessManagerTests, ArgyllRunner*Tests, ProcessRunSupportTests, store/UI suites, and the runner suites embedded in TargenTests / PrinttargTests / ProcessManagerTests. Also qualifies six bare `throw .case` expressions in CGATSParser with CGATSParseError — they only compiled under typed throws, which Slice 1 demoted to untyped `throws`; without this the ICCeryCore target fails to build and no test gate can run. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
64 lines
2.1 KiB
Swift
64 lines
2.1 KiB
Swift
import Foundation
|
|
import XCTest
|
|
@testable import ICCeryCore
|
|
|
|
final class ColprofArgsTests: XCTestCase {
|
|
|
|
func testDefaults() throws {
|
|
let config = ColprofConfig(basename: "target")
|
|
let args = try ColprofArgs.build(config: config)
|
|
XCTAssertEqual(args, ["-v", "-a", "l", "-q", "m", "target"])
|
|
}
|
|
|
|
func testFwaBareFlag() throws {
|
|
let config = ColprofConfig(fwa: "", basename: "target")
|
|
let args = try ColprofArgs.build(config: config)
|
|
XCTAssertEqual(args, ["-v", "-a", "l", "-q", "m", "-f", "target"])
|
|
}
|
|
|
|
func testFwaD50() throws {
|
|
let config = ColprofConfig(fwa: "D50", basename: "target")
|
|
let args = try ColprofArgs.build(config: config)
|
|
XCTAssertTrue(args.contains("-f"))
|
|
XCTAssertTrue(args.contains("D50"))
|
|
XCTAssertEqual(args.last, "target")
|
|
}
|
|
|
|
func testFwaNoneOmitted() throws {
|
|
let config = ColprofConfig(fwa: "none", basename: "target")
|
|
let args = try ColprofArgs.build(config: config)
|
|
XCTAssertFalse(args.contains("-f"))
|
|
}
|
|
|
|
func testViewingCondNoneSkipped() throws {
|
|
let config = ColprofConfig(
|
|
inputViewingCond: "none",
|
|
outputViewingCond: "mt",
|
|
basename: "target"
|
|
)
|
|
let args = try ColprofArgs.build(config: config)
|
|
XCTAssertFalse(args.contains("-c"))
|
|
XCTAssertTrue(args.contains("-d"))
|
|
XCTAssertTrue(args.contains("mt"))
|
|
}
|
|
|
|
func testDescriptionFallback() throws {
|
|
let config = ColprofConfig(description: "", basename: "target")
|
|
let args = try ColprofArgs.build(config: config)
|
|
XCTAssertFalse(args.contains("-D"))
|
|
}
|
|
|
|
func testCopyright() throws {
|
|
let config = ColprofConfig(copyright: "Gronod 2026", basename: "target")
|
|
let args = try ColprofArgs.build(config: config)
|
|
XCTAssertTrue(args.contains("-C"))
|
|
XCTAssertTrue(args.contains("Gronod 2026"))
|
|
}
|
|
|
|
func testNoProgressJsonFlag() throws {
|
|
let config = ColprofConfig(basename: "target")
|
|
let args = try ColprofArgs.build(config: config)
|
|
XCTAssertFalse(args.contains("-u"))
|
|
}
|
|
}
|