will this work for platform-specific errnos? WIP
This commit is contained in:
@@ -22,7 +22,8 @@ unsafe fn test_path_symlink_trailing_slashes(dir_fd: wasi::Fd) {
|
|||||||
wasi::path_symlink("source", dir_fd, "target/")
|
wasi::path_symlink("source", dir_fd, "target/")
|
||||||
.expect_err("link destination already exists")
|
.expect_err("link destination already exists")
|
||||||
.raw_error(),
|
.raw_error(),
|
||||||
wasi::ERRNO_EXIST,
|
windows => wasi::ERRNO_NOENT,
|
||||||
|
wasi::ERRNO_EXIST
|
||||||
);
|
);
|
||||||
wasi::path_remove_directory(dir_fd, "target").expect("removing a directory");
|
wasi::path_remove_directory(dir_fd, "target").expect("removing a directory");
|
||||||
|
|
||||||
|
|||||||
@@ -67,6 +67,22 @@ macro_rules! assert_errno {
|
|||||||
($s:expr, $( $i:expr ),+,) => {
|
($s:expr, $( $i:expr ),+,) => {
|
||||||
assert_errno!($s, $( $i ),+)
|
assert_errno!($s, $( $i ),+)
|
||||||
};
|
};
|
||||||
|
($s:expr, windows => $i:expr, $( $rest:expr ),+) => {
|
||||||
|
let e = $s;
|
||||||
|
if std::env::var("ERRNO_EXPECT_WINDOWS").is_ok() {
|
||||||
|
assert_errno!(e, $i);
|
||||||
|
} else {
|
||||||
|
assert_errno!(e, $($rest),+, $i);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
($s:expr, linux => $i:expr, $( $rest:expr ),+) => {
|
||||||
|
let e = $s;
|
||||||
|
if std::env::var("ERRNO_EXPECT_LINUX").is_ok() {
|
||||||
|
assert_errno!(e, $i);
|
||||||
|
} else {
|
||||||
|
assert_errno!(e, $($rest),+, $i);
|
||||||
|
}
|
||||||
|
};
|
||||||
($s:expr, $( $i:expr ),+) => {
|
($s:expr, $( $i:expr ),+) => {
|
||||||
let e = $s;
|
let e = $s;
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user