Skip to content

Commit ed87628

Browse files
committed
NFC: Refactor testImmediateMode() to avoid requiring Swift 5.9.
1 parent 5378531 commit ed87628

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

Tests/SwiftDriverTests/SwiftDriverTests.swift

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3552,12 +3552,11 @@ final class SwiftDriverTests: XCTestCase {
35523552

35533553
if driver.targetTriple.isMacOSX {
35543554
let sdkIdx = try XCTUnwrap(job.commandLine.firstIndex(of: .flag("-sdk")))
3555-
let sdkPathOpt: VirtualPath? = switch job.commandLine[sdkIdx + 1] {
3556-
case .path(let path): path
3557-
default: nil
3555+
if case .path(let path) = job.commandLine[sdkIdx + 1] {
3556+
XCTAssertTrue(path.name.contains("MacOSX.platform"))
3557+
} else {
3558+
XCTFail("Missing SDK path")
35583559
}
3559-
let sdkPath = try XCTUnwrap(sdkPathOpt)
3560-
XCTAssertTrue(sdkPath.name.contains("MacOSX.platform"))
35613560
}
35623561

35633562
XCTAssertFalse(job.commandLine.contains(.flag("--")))

0 commit comments

Comments
 (0)