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>
28 lines
966 B
Swift
28 lines
966 B
Swift
import Foundation
|
|
import XCTest
|
|
@testable import ICCeryCore
|
|
|
|
final class ApplycalArgsTests: XCTestCase {
|
|
|
|
func testApplyArgv() throws {
|
|
let config = ApplycalConfig(
|
|
calibrationPath: "/tmp/cal.cal",
|
|
inputProfileURL: URL(fileURLWithPath: "/tmp/profile.icc")
|
|
)
|
|
let args = try ApplycalArgs.build(config: config)
|
|
XCTAssertEqual(args, ["-v", "-a", "/tmp/cal.cal", "/tmp/profile.icc"])
|
|
}
|
|
|
|
func testUnapplyEmittedWhenConfigSet() throws {
|
|
let config = ApplycalConfig(
|
|
calibrationPath: "/tmp/cal.cal",
|
|
inputProfileURL: URL(fileURLWithPath: "/tmp/profile.icc"),
|
|
unapply: true
|
|
)
|
|
let args = try ApplycalArgs.build(config: config)
|
|
// Builder emits -u only when the caller explicitly sets unapply.
|
|
// The UI layer never passes unapply: true in v2.0.
|
|
XCTAssertEqual(args, ["-v", "-u", "/tmp/cal.cal", "/tmp/profile.icc"])
|
|
}
|
|
}
|