Skip to content

Commit d7d5710

Browse files
authored
tests: repair TestNSData/test_writeToURLSpecialFile (#3044)
This test was added recently and regressed the test suite on Windows. Windows does not have a devfs mounted at `/dev`. Use the `CON` special file which is roughly equivalent to `/dev/stdout` to emulate the desired test behaviour.
1 parent 01efe01 commit d7d5710

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Tests/Foundation/Tests/TestNSData.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -625,7 +625,11 @@ class TestNSData: LoopbackServerTest {
625625
}
626626

627627
func test_writeToURLSpecialFile() {
628+
#if os(Windows)
629+
let url = URL(fileURLWithPath: "CON")
630+
#else
628631
let url = URL(fileURLWithPath: "/dev/stdout")
632+
#endif
629633
XCTAssertNoThrow(try Data("Output to STDOUT\n".utf8).write(to: url))
630634
}
631635

0 commit comments

Comments
 (0)