std.fs.test: fix file operations on directories on NetBSD

As noted earlier in this test, reading directories does not fail on NetBSD.
This commit is contained in:
Alex Rønne Petersen
2026-01-19 14:37:09 +01:00
parent 35a191ec1c
commit 9f33c339c7
+5 -3
View File
@@ -845,9 +845,11 @@ test "file operations on directories" {
defer handle.close(io);
// Reading from the handle should fail
var buf: [1]u8 = undefined;
try expectError(error.IsDir, handle.readStreaming(io, &.{&buf}));
try expectError(error.IsDir, handle.readPositional(io, &.{&buf}, 0));
if (native_os != .netbsd) {
var buf: [1]u8 = undefined;
try expectError(error.IsDir, handle.readStreaming(io, &.{&buf}));
try expectError(error.IsDir, handle.readPositional(io, &.{&buf}, 0));
}
}
try expectError(error.IsDir, ctx.dir.openFile(io, test_dir_name, .{ .allow_directory = false, .mode = .read_only }));