diff --git a/crates/test-programs/wasi-tests/src/bin/path_open_read_without_rights.rs b/crates/test-programs/wasi-tests/src/bin/path_open_read_without_rights.rs index 47d4c7aaa3..26113c08c8 100644 --- a/crates/test-programs/wasi-tests/src/bin/path_open_read_without_rights.rs +++ b/crates/test-programs/wasi-tests/src/bin/path_open_read_without_rights.rs @@ -1,6 +1,6 @@ use std::{env, process}; use wasi_tests::open_scratch_directory; -use wasi_tests::{drop_rights, fd_get_rights, create_file}; +use wasi_tests::{create_file, drop_rights, fd_get_rights}; const TEST_FILENAME: &'static str = "file"; @@ -27,8 +27,13 @@ unsafe fn try_read_file(dir_fd: wasi::Fd) { }; // Since we no longer have the right to fd_read, trying to read a file // should be an error. - let err = wasi::fd_read(fd, &[iovec]).expect_err("reading bytes from file should fail"); - assert_eq!(err, wasi::ERRNO_NOTCAPABLE, "the errno should be ENOTCAPABLE"); + assert_eq!( + wasi::fd_read(fd, &[iovec]) + .expect_err("reading bytes from file should fail") + .raw_error(), + wasi::ERRNO_NOTCAPABLE, + "the errno should be ENOTCAPABLE" + ); } unsafe fn test_read_rights(dir_fd: wasi::Fd) {