We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5e0b63d commit 912fb83Copy full SHA for 912fb83
TestFoundation/TestURL.swift
@@ -98,6 +98,19 @@ class TestURL : XCTestCase {
98
99
let u4 = URL(fileURLWithPath: "S:\\b\\u3//\\//")
100
XCTAssertEqual(u4.absoluteString, "file:///S:/b/u3/")
101
+
102
+ // ensure leading slash doesn't break everything
103
+ let u5 = URL(fileURLWithPath: "\\abs\\path")
104
+ XCTAssertEqual(u5.absoluteString, "file:///abs/path")
105
+ XCTAssertEqual(u5.path, "/abs/path")
106
107
+ let u6 = u5.appendingPathComponent("test")
108
+ XCTAssertEqual(u6.absoluteString, "file:///abs/path/test")
109
+ XCTAssertEqual(u6.path, "/abs/path/test")
110
111
+ let u7 = u6.deletingLastPathComponent()
112
+ XCTAssertEqual(u7.absoluteString, "file:///abs/path/")
113
+ XCTAssertEqual(u7.path, "/abs/path")
114
}
115
#endif
116
0 commit comments