macro_rules! assert_not_matches {
($expression:expr, $pattern:pat if $guard:expr $(,)?) => { ... };
($expression:expr, $pattern:pat) => { ... };
($expression:expr, $pattern:pat if $guard:expr, $($message:tt)+) => { ... };
($expression:expr, $pattern:pat, $($message:tt)+) => { ... };
}Expand description
Assert expression is Some.
-
If true, return
(). -
Otherwise, call
panic!with a message and the values of the expressions with their debug representations.
§Examples
use assertables::*;
let a = 'a';
assert_not_matches!(a, 'b'..='z');
// This will panic
let a = 'a';
assert_not_matches!(a, 'a'..='z');
// assertion failed: `assert_not_matches!(a)`
// https://docs.rs/assertables/…/assertables/macro.assert_not_matches.html
// args: `a, 'a'..='z'`