Skip to content

Commit c52b422

Browse files
authored
FoundationEssentialTests: elide some tests on Windows (#600)
Windows does not have the concept of a "root" user, instead all users have rights assigned to them with a capabilities system. As there is no equivalent for `euid`, simply elide this suite on Windows for now.
1 parent 019d081 commit c52b422

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Tests/FoundationEssentialsTests/FileManager/FileManagerTests.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,8 +523,11 @@ final class FileManagerTests : XCTestCase {
523523
XCTAssertFalse($0.fileExists(atPath: "does_not_exist"))
524524
}
525525
}
526-
526+
527527
func testFileAccessAtPath() throws {
528+
#if os(Windows)
529+
throw XCTSkip("Windows filesystems do not conform to POSIX semantics")
530+
#else
528531
guard getuid() != 0 else {
529532
// Root users can always access anything, so this test will not function when run as root
530533
throw XCTSkip("This test is not available when running as the root user")
@@ -551,8 +554,9 @@ final class FileManagerTests : XCTestCase {
551554
XCTAssertTrue($0.isDeletableFile(atPath: file), "'\(file)' failed deletable check")
552555
}
553556
}
557+
#endif
554558
}
555-
559+
556560
func testFileSystemAttributesAtPath() throws {
557561
try FileManagerPlayground {
558562
"Foo"

0 commit comments

Comments
 (0)