diff --git a/Tests/Foundation/Tests/TestProcess.swift b/Tests/Foundation/Tests/TestProcess.swift index 4d3f08006d..0c32f05e0d 100644 --- a/Tests/Foundation/Tests/TestProcess.swift +++ b/Tests/Foundation/Tests/TestProcess.swift @@ -634,7 +634,16 @@ class TestProcess : XCTestCase { do { let (stdout, _) = try runTask([xdgTestHelperURL().path, "--getcwd"], currentDirectoryPath: "/") - XCTAssertEqual(stdout.trimmingCharacters(in: CharacterSet(["\n", "\r"])), "/") + var directory = stdout.trimmingCharacters(in: CharacterSet(["\n", "\r"])) +#if os(Windows) + let zero: String.Index = directory.startIndex + let one: String.Index = directory.index(zero, offsetBy: 1) + XCTAssertTrue(directory[zero].isLetter) + XCTAssertEqual(directory[one], ":") + directory = "/" + String(directory.dropFirst(2)) +#endif + XCTAssertEqual(URL(fileURLWithPath: directory).absoluteURL, + URL(fileURLWithPath: "/").absoluteURL) } do {