commit 9f33c339c72d8aff92aefea01331b76a7829eb12 (tree)
parent 35a191ec1ca8b39ce6b9460e00a5efaf56851345
Author: Alex Rønne Petersen <alex@alexrp.com>
Date: Mon, 19 Jan 2026 14:37:09 +0100
std.fs.test: fix `file operations on directories` on NetBSD
As noted earlier in this test, reading directories does not fail on NetBSD.
Diffstat:
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/lib/std/fs/test.zig b/lib/std/fs/test.zig
@@ -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 }));