Skip to content

Commit

Permalink
Merge pull request #857 from ahoppen/skip-tests
Browse files Browse the repository at this point in the history
Skip missing configuration file tests on Windows for Swift < 6.0.2
  • Loading branch information
ahoppen authored Oct 18, 2024
2 parents 06ca47b + 8581f2c commit 29197fe
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 29197fe

Please sign in to comment.