From 8581f2c6964de247aec49aea06f705778f073a1b Mon Sep 17 00:00:00 2001 From: Alex Hoppen Date: Thu, 17 Oct 2024 15:10:59 -0700 Subject: [PATCH] Skip missing configuration file tests on Windows for Swift < 6.0.2 We require https://github.com/swiftlang/swift-foundation/pull/983 to be in the toolchain for these test to pass. --- .../API/ConfigurationTests.swift | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/Tests/SwiftFormatTests/API/ConfigurationTests.swift b/Tests/SwiftFormatTests/API/ConfigurationTests.swift index e96331db..86a9d8dd 100644 --- a/Tests/SwiftFormatTests/API/ConfigurationTests.swift +++ b/Tests/SwiftFormatTests/API/ConfigurationTests.swift @@ -18,8 +18,11 @@ final class ConfigurationTests: XCTestCase { XCTAssertEqual(defaultInitConfig, emptyJSONConfig) } - func testMissingConfigurationFile() { + func testMissingConfigurationFile() throws { #if os(Windows) + #if compiler(<6.0.2) + try XCTSkipIf(true, "Requires https://github.com/swiftlang/swift-foundation/pull/983") + #endif let path = #"C:\test.swift"# #else let path = "/test.swift" @@ -27,8 +30,11 @@ final class ConfigurationTests: XCTestCase { XCTAssertNil(Configuration.url(forConfigurationFileApplyingTo: URL(fileURLWithPath: path))) } - func testMissingConfigurationFileInSubdirectory() { + func testMissingConfigurationFileInSubdirectory() throws { #if os(Windows) + #if compiler(<6.0.2) + try XCTSkipIf(true, "Requires https://github.com/swiftlang/swift-foundation/pull/983") + #endif let path = #"C:\whatever\test.swift"# #else let path = "/whatever/test.swift" @@ -37,7 +43,11 @@ final class ConfigurationTests: XCTestCase { } func testMissingConfigurationFileMountedDirectory() throws { - #if !os(Windows) + #if os(Windows) + #if compiler(<6.0.2) + try XCTSkipIf(true, "Requires https://github.com/swiftlang/swift-foundation/pull/983") + #endif + #else try XCTSkipIf(true, #"\\ file mounts are only a concept on Windows"#) #endif let path = #"\\mount\test.swift"#