Skip to content

Commit b1fc976

Browse files
committed
[Windows] Fix test_reachable
Windows doesn't have `/data` or `/usr`. Since Windows does not guarantee a drive letter actually existing, defer to NSHomeDirectory to give us a directory which should always exist.
1 parent 05cb315 commit b1fc976

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

TestFoundation/TestURL.swift

+4
Original file line numberDiff line numberDiff line change
@@ -495,6 +495,8 @@ class TestURL : XCTestCase {
495495
func test_reachable() {
496496
#if os(Android)
497497
var url = URL(fileURLWithPath: "/data")
498+
#elseif os(Windows)
499+
var url = URL(fileURLWithPath: NSHomeDirectory())
498500
#else
499501
var url = URL(fileURLWithPath: "/usr")
500502
#endif
@@ -524,6 +526,8 @@ class TestURL : XCTestCase {
524526

525527
#if os(Android)
526528
var nsURL = NSURL(fileURLWithPath: "/data")
529+
#elseif os(Windows)
530+
var nsURL = NSURL(fileURLWithPath: NSHomeDirectory())
527531
#else
528532
var nsURL = NSURL(fileURLWithPath: "/usr")
529533
#endif

0 commit comments

Comments
 (0)