Skip to content

Commit bd2e810

Browse files
committed
Tests: correct spelling of /dev/null on Windows
Windows uses a per-directory `NUL` rather than a global `/dev/null`. Adjust the test to use the appropriate spelling rather than potentially seeing a random drive-relative path which may exist as a deletable file.
1 parent 9067cce commit bd2e810

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Tests/Foundation/Tests/TestFileManager.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,11 @@ class TestFileManager : XCTestCase {
322322
catch { XCTFail("\(error)") }
323323

324324
// test against known undeletable file
325+
#if os(Windows)
326+
XCTAssertFalse(fm.isDeletableFile(atPath: "NUL"))
327+
#else
325328
XCTAssertFalse(fm.isDeletableFile(atPath: "/dev/null"))
329+
#endif
326330
}
327331

328332
func test_fileAttributes() throws {

0 commit comments

Comments
 (0)