From 036fd8ead5e3637bc3f9965643313c64d270d473 Mon Sep 17 00:00:00 2001 From: Jakub Konka Date: Thu, 9 Jan 2020 21:16:31 +0100 Subject: [PATCH] Fix path_open_read_without_rights test Fixes `path_open_read_without_rights` test making the CI green again. --- .../src/bin/path_open_read_without_rights.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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) {