File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -105,6 +105,19 @@ class TestURL : XCTestCase {
105
105
106
106
let u4 = URL ( fileURLWithPath: " S: \\ b \\ u3// \\ // " )
107
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 " )
108
121
}
109
122
#endif
110
123
You can’t perform that action at this time.
0 commit comments