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.
2 parents 73b22b1 + e126af9 commit f80087aCopy full SHA for f80087a
Tests/Foundation/Tests/TestURL.swift
@@ -105,6 +105,19 @@ class TestURL : XCTestCase {
105
106
let u4 = URL(fileURLWithPath: "S:\\b\\u3//\\//")
107
XCTAssertEqual(u4.absoluteString, "file:///S:/b/u3/")
108
+
109
+ // ensure leading slash doesn't break everything
110
+ let u5 = URL(fileURLWithPath: "\\abs\\path")
111
+ XCTAssertEqual(u5.absoluteString, "file:///abs/path")
112
+ XCTAssertEqual(u5.path, "/abs/path")
113
114
+ let u6 = u5.appendingPathComponent("test")
115
+ XCTAssertEqual(u6.absoluteString, "file:///abs/path/test")
116
+ XCTAssertEqual(u6.path, "/abs/path/test")
117
118
+ let u7 = u6.deletingLastPathComponent()
119
+ XCTAssertEqual(u7.absoluteString, "file:///abs/path/")
120
+ XCTAssertEqual(u7.path, "/abs/path")
121
}
122
#endif
123
0 commit comments