authorgravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2020-06-28 13:56:00-07:00
committergravatar for squeek502@hotmail.comRyan Liptak <squeek502@hotmail.com> 2020-06-28 13:56:00-07:00
log74c245aea94ebcf05651a6f3420d8c3a7145f9d7
treee30c695a9df2e9a6246fca2397217282ea790a3a
parent12aca758c6ee923065d1d64a62e44c8a8fd6cd99

Disable wasi 'readFileAlloc on a directory' assertion for now


1 files changed, 7 insertions(+), 2 deletions(-)

lib/std/fs/test.zig+7-2
......@@ -83,8 +83,13 @@ test "file operations on directories" {
8383
8484 testing.expectError(error.IsDir, tmp_dir.dir.createFile(test_dir_name, .{}));
8585 testing.expectError(error.IsDir, tmp_dir.dir.deleteFile(test_dir_name));
86 testing.expectError(error.IsDir, tmp_dir.dir.readFileAlloc(testing.allocator, test_dir_name, std.math.maxInt(usize)));
87 // note: the `.write = true` is necessary to ensure the error occurs on all platforms
86 // Currently, WASI will return error.Unexpected (via ENOTCAPABLE) when attempting fd_read on a directory handle.
87 // TODO: Re-enable on WASI once https://github.com/bytecodealliance/wasmtime/issues/1935 is resolved.
88 if (builtin.os.tag != .wasi) {
89 testing.expectError(error.IsDir, tmp_dir.dir.readFileAlloc(testing.allocator, test_dir_name, std.math.maxInt(usize)));
90 }
91 // Note: The `.write = true` is necessary to ensure the error occurs on all platforms.
92 // TODO: Add a read-only test as well, see https://github.com/ziglang/zig/issues/5732
8893 testing.expectError(error.IsDir, tmp_dir.dir.openFile(test_dir_name, .{ .write = true }));
8994
9095 if (builtin.os.tag != .wasi) {