Skip to content

Commit bdc419e

Browse files
author
David Ungar
committed
Improve test
1 parent 01a6386 commit bdc419e

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1475,8 +1475,10 @@ final class SwiftDriverTests: XCTestCase {
14751475
struct MockExecutor: DriverExecutor {
14761476
let resolver = try! ArgsResolver(fileSystem: localFileSystem)
14771477

1478+
struct ShouldNeverGetHere: LocalizedError {}
1479+
14781480
func execute(job: Job, forceResponseFiles: Bool, recordedInputModificationDates: [TypedVirtualPath : Date]) throws -> ProcessResult {
1479-
fatalError()
1481+
throw ShouldNeverGetHere()
14801482
}
14811483
func execute(workload: DriverExecutorWorkload,
14821484
delegate: JobExecutionDelegate,
@@ -1486,11 +1488,11 @@ final class SwiftDriverTests: XCTestCase {
14861488
XCTAssert(workload.continueBuildingAfterErrors)
14871489
}
14881490
func checkNonZeroExit(args: String..., environment: [String : String]) throws -> String {
1489-
fatalError()
1491+
throw ShouldNeverGetHere()
14901492
}
14911493
func description(of job: Job, forceResponseFiles: Bool) throws -> String {
1492-
fatalError()
1493-
}
1494+
throw ShouldNeverGetHere()
1495+
}
14941496
}
14951497

14961498
let driver = try Driver(args: ["swiftc", "foo1.swift", "bar1.swift", "-enable-batch-mode", "-driver-use-frontend-path", "/bin/echo"], executor: MockExecutor())

0 commit comments

Comments
 (0)