| ... | @@ -827,11 +827,6 @@ test "file operations on directories" { | ... | @@ -827,11 +827,6 @@ test "file operations on directories" { |
| 827 | const buf = try ctx.dir.readFileAlloc(io, test_dir_name, testing.allocator, .unlimited); | 827 | const buf = try ctx.dir.readFileAlloc(io, test_dir_name, testing.allocator, .unlimited); |
| 828 | testing.allocator.free(buf); | 828 | testing.allocator.free(buf); |
| 829 | }, | 829 | }, |
| 830 | .wasi => { | | |
| 831 | // WASI return EBADF, which gets mapped to NotOpenForReading. | | |
| 832 | // See https://github.com/bytecodealliance/wasmtime/issues/1935 | | |
| 833 | try expectError(error.NotOpenForReading, ctx.dir.readFileAlloc(io, test_dir_name, testing.allocator, .unlimited)); | | |
| 834 | }, | | |
| 835 | else => { | 830 | else => { |
| 836 | try expectError(error.IsDir, ctx.dir.readFileAlloc(io, test_dir_name, testing.allocator, .unlimited)); | 831 | try expectError(error.IsDir, ctx.dir.readFileAlloc(io, test_dir_name, testing.allocator, .unlimited)); |
| 837 | }, | 832 | }, |
| ... | @@ -851,13 +846,9 @@ test "file operations on directories" { | ... | @@ -851,13 +846,9 @@ test "file operations on directories" { |
| 851 | defer handle.close(io); | 846 | defer handle.close(io); |
| 852 | | 847 | |
| 853 | // Reading from the handle should fail | 848 | // Reading from the handle should fail |
| 854 | const expected_err = switch (native_os) { | | |
| 855 | .wasi => error.NotOpenForReading, | | |
| 856 | else => error.IsDir, | | |
| 857 | }; | | |
| 858 | var buf: [1]u8 = undefined; | 849 | var buf: [1]u8 = undefined; |
| 859 | try expectError(expected_err, handle.readStreaming(io, &.{&buf})); | 850 | try expectError(error.IsDir, handle.readStreaming(io, &.{&buf})); |
| 860 | try expectError(expected_err, handle.readPositional(io, &.{&buf}, 0)); | 851 | try expectError(error.IsDir, handle.readPositional(io, &.{&buf}, 0)); |
| 861 | } | 852 | } |
| 862 | try expectError(error.IsDir, ctx.dir.openFile(io, test_dir_name, .{ .allow_directory = false, .mode = .read_only })); | 853 | try expectError(error.IsDir, ctx.dir.openFile(io, test_dir_name, .{ .allow_directory = false, .mode = .read_only })); |
| 863 | | 854 | |