Skip to content

Commit

Permalink
Skip missing configuration file tests on Windows for Swift < 6.0.2
Browse files Browse the repository at this point in the history
We require swiftlang/swift-foundation#983 to be in the toolchain for these test to pass.
  • Loading branch information
ahoppen committed Oct 17, 2024
1 parent 06ca47b commit 8581f2c
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Tests/SwiftFormatTests/API/ConfigurationTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,23 @@ 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"
#endif
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"
Expand All @@ -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"#
Expand Down

0 comments on commit 8581f2c

Please sign in to comment.