Fix path_open_read_without_rights test
Fixes `path_open_read_without_rights` test making the CI green again.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
use std::{env, process};
|
use std::{env, process};
|
||||||
use wasi_tests::open_scratch_directory;
|
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";
|
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
|
// Since we no longer have the right to fd_read, trying to read a file
|
||||||
// should be an error.
|
// should be an error.
|
||||||
let err = wasi::fd_read(fd, &[iovec]).expect_err("reading bytes from file should fail");
|
assert_eq!(
|
||||||
assert_eq!(err, wasi::ERRNO_NOTCAPABLE, "the errno should be ENOTCAPABLE");
|
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) {
|
unsafe fn test_read_rights(dir_fd: wasi::Fd) {
|
||||||
|
|||||||
Reference in New Issue
Block a user