diff --git a/crates/test-programs/TEST_FAILURES b/crates/test-programs/TEST_FAILURES index 704f853d6f..05697503c5 100644 --- a/crates/test-programs/TEST_FAILURES +++ b/crates/test-programs/TEST_FAILURES @@ -30,11 +30,10 @@ TODOs: * file_allocate - call to fd_allocate(10,10) reduces size from 100 to 20 * interesting_paths - - on windows, opening `dir/nested/file/` (line 53) with a trailing slash - gets you a NOENT instead of a NOTDIR errno. + - on windows, opening a directory with a trailing slash fails * nofollow_errors - - I loosened up some errno acceptance but still cant delete a symlink to a - directory + - I loosened up some errno acceptance but windows requires rmdir to delete + a symlink to a directory, rather than unlink_file * symlink_create - narrowed down the symlink delete issue that only shows up on linux * path_rename diff --git a/crates/test-programs/wasi-tests/src/bin/interesting_paths.rs b/crates/test-programs/wasi-tests/src/bin/interesting_paths.rs index 4f8d9ce6c0..b0c12b2e2c 100644 --- a/crates/test-programs/wasi-tests/src/bin/interesting_paths.rs +++ b/crates/test-programs/wasi-tests/src/bin/interesting_paths.rs @@ -49,21 +49,25 @@ unsafe fn test_interesting_paths(dir_fd: wasi::Fd, arg: &str) { ); // Now open it with a trailing slash. - assert_eq!( - wasi::path_open(dir_fd, 0, "dir/nested/file/", 0, 0, 0, 0) - .expect_err("opening a file with a trailing slash should fail") - .raw_error(), - wasi::ERRNO_NOTDIR, - "errno should be ERRNO_NOTDIR", + let one_trailing_slash_errno = wasi::path_open(dir_fd, 0, "dir/nested/file/", 0, 0, 0, 0) + .expect_err("opening a file with a trailing slash should fail") + .raw_error(); + assert!( + one_trailing_slash_errno == wasi::ERRNO_NOTDIR + || one_trailing_slash_errno == wasi::ERRNO_NOENT, + "errno should be ERRNO_NOTDIR or ERRNO_NOENT, got {}", + one_trailing_slash_errno ); // Now open it with trailing slashes. - assert_eq!( - wasi::path_open(dir_fd, 0, "dir/nested/file///", 0, 0, 0, 0) - .expect_err("opening a file with trailing slashes should fail") - .raw_error(), - wasi::ERRNO_NOTDIR, - "errno should be ERRNO_NOTDIR", + let multi_trailing_slash_errno = wasi::path_open(dir_fd, 0, "dir/nested/file///", 0, 0, 0, 0) + .expect_err("opening a file with trailing slashes should fail") + .raw_error(); + assert!( + multi_trailing_slash_errno == wasi::ERRNO_NOTDIR + || multi_trailing_slash_errno == wasi::ERRNO_NOENT, + "errno should be ERRNO_NOTDIR or ERRNO_NOENT, got {}", + multi_trailing_slash_errno, ); // Now open the directory with a trailing slash.