Skip to content

Commit cd0bc7b

Browse files
authored
Merge pull request #2675 from compnerd/enoent
Foundation: remove file system assumptions
2 parents 6114ed0 + a422ef4 commit cd0bc7b

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Tests/Foundation/Tests/TestURL.swift

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,12 +78,19 @@ class TestURL : XCTestCase {
7878
XCTAssertEqual(u6.absoluteString, "file:///S:/b/u6/")
7979

8080
// ensure that we do not index beyond the start of the string
81-
let u7 = URL(fileURLWithPath: "eh", relativeTo: URL(fileURLWithPath: "S:\\b"))
81+
// NOTE: explicitly mark `S:\b` as a directory as this test expects the
82+
// directory to exist to determine that it is a directory.
83+
let u7 = URL(fileURLWithPath: "eh",
84+
relativeTo: URL(fileURLWithPath: "S:\\b", isDirectory: true))
8285
XCTAssertEqual(u7.absoluteString, "file:///S:/b/eh")
8386

87+
let u8 = URL(fileURLWithPath: "eh",
88+
relativeTo: URL(fileURLWithPath: "S:\\b", isDirectory: false))
89+
XCTAssertEqual(u8.absoluteString, "file:///S:/eh")
90+
8491
// ensure that / is handled properly
85-
let u8 = URL(fileURLWithPath: "/")
86-
XCTAssertEqual(u8.absoluteString, "file:///")
92+
let u9 = URL(fileURLWithPath: "/")
93+
XCTAssertEqual(u9.absoluteString, "file:///")
8794
}
8895

8996
func test_WindowsPathSeparator2() {

0 commit comments

Comments
 (0)