fix macro by denying trailing slashes. also other stuff

This commit is contained in:
Pat Hickey
2021-01-28 12:23:48 -08:00
parent 20e9169cc7
commit 1196e216e9
22 changed files with 77 additions and 72 deletions

View File

@@ -69,23 +69,20 @@ pub unsafe fn drop_rights(fd: wasi::Fd, drop_base: wasi::Rights, drop_inheriting
#[macro_export]
macro_rules! assert_errno {
($s:expr, $( $i:expr ),+,) => {
assert_errno!($s, $( $i ),+)
};
($s:expr, windows => $i:expr, $( $rest:expr ),+) => {
($s:expr, windows => $i:expr, $( $rest:tt )+) => {
let e = $s;
if $crate::TESTCONFIG.errno_expect_windows() {
assert_errno!(e, $i);
} else {
assert_errno!(e, $($rest),+, $i);
assert_errno!(e, $($rest)+, $i);
}
};
($s:expr, unix => $i:expr, $( $rest:expr ),+) => {
($s:expr, unix => $i:expr, $( $rest:tt )+) => {
let e = $s;
if $crate::TESTCONFIG.errno_expect_unix() {
assert_errno!(e, $i);
} else {
assert_errno!(e, $($rest),+, $i);
assert_errno!(e, $($rest)+, $i);
}
};
($s:expr, $( $i:expr ),+) => {