diff options
Diffstat (limited to 'tests/util')
-rw-r--r-- | tests/util/mod.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/util/mod.rs b/tests/util/mod.rs index 2bda9ba..bd207a9 100644 --- a/tests/util/mod.rs +++ b/tests/util/mod.rs @@ -22,6 +22,21 @@ macro_rules! unwrap_ok { } #[macro_export] +macro_rules! assert_any_ok { + ($val:expr) => {{ + match &$val { + Ok(_) => {} + Err(err) => panic!( + r#"assertion failed: `(left == right)` + left: `Ok(_)`, + right: `Err({:?})`"#, + err + ), + } + }}; +} + +#[macro_export] macro_rules! assert_ok { ($left:expr, $right:expr) => {{ match &$right { |