macro_rules! assert_is_empty {
($a:expr $(,)?) => { ... };
($a:expr, $($message:tt)+) => { ... };
}Expand description
Assert an expression (such as a string or array) is empty.
Pseudocode:
a.is_empty()
-
If true, return
(). -
Otherwise, call
panic!with a message and the values of the expressions with their debug representations.
§Examples
use assertables::*;
let a = "";
assert_is_empty!(a);
// This will panic
let a = "alfa";
assert_is_empty!(a);
// assertion failed: `assert_is_empty!(a)`
// https://docs.rs/assertables/…/assertables/macro.assert_is_empty.html
// label: `a`,
// debug: `\"alfa\"`