Skip to content

Commit f413444

Browse files
committed
tests: disable a test on Windows
Windows does not have the `PWD` environment variable. The closest analogue is the `%CD%` magic variable which is specific to the shell rather than the environment. Skip the test on Windows.
1 parent f80087a commit f413444

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Tests/Foundation/Tests/TestProcess.swift

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -638,12 +638,17 @@ class TestProcess : XCTestCase {
638638
}
639639

640640
do {
641+
// NOTE: Windows does have an environment variable called `PWD`.
642+
// The closed thing is %CD% which is a property of the shell rather
643+
// than the environment. Simply ignore this test on Windows.
644+
#if !os(Windows)
641645
XCTAssertNotEqual("/", FileManager.default.currentDirectoryPath)
642646
XCTAssertNotEqual(FileManager.default.currentDirectoryPath, "/")
643647
let (stdout, _) = try runTask([xdgTestHelperURL().path, "--echo-PWD"], currentDirectoryPath: "/")
644648
let directory = stdout.trimmingCharacters(in: CharacterSet(["\n", "\r"]))
645649
XCTAssertEqual(directory, ProcessInfo.processInfo.environment["PWD"])
646650
XCTAssertNotEqual(directory, "/")
651+
#endif
647652
}
648653

649654
do {

0 commit comments

Comments
 (0)