From 6103e2ede4b9581e79ec8a23e5831969fbb4d0e8 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 6 Jun 2023 08:21:33 -0700 Subject: [PATCH] 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. --- Tests/Foundation/Tests/TestFileManager.swift | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Tests/Foundation/Tests/TestFileManager.swift b/Tests/Foundation/Tests/TestFileManager.swift index 33f1d3ec31..b90b5d17a9 100644 --- a/Tests/Foundation/Tests/TestFileManager.swift +++ b/Tests/Foundation/Tests/TestFileManager.swift @@ -322,7 +322,11 @@ class TestFileManager : XCTestCase { catch { XCTFail("\(error)") } // test against known undeletable file +#if os(Windows) + XCTAssertFalse(fm.isDeletableFile(atPath: "NUL")) +#else XCTAssertFalse(fm.isDeletableFile(atPath: "/dev/null")) +#endif } func test_fileAttributes() throws {