macro_rules! assert_len_ge {
($a:expr, $b:expr $(,)?) => { ... };
($a:expr, $b:expr, $($message:tt)+) => { ... };
}Expand description
Assert a length is greater than or equal to another.
Pseudocode:
a.len() ≥ b.len()
-
If true, return
(a.len(), b.len()). -
Otherwise, call
panic!with a message and the values of the expressions with their debug representations.
§Examples
use assertables::*;
let a = "xx";
let b = "x";
assert_len_ge!(a, b);
// This will panic
let a = "x";
let b = "xx";
assert_len_ge!(a, b);
// assertion failed: `assert_len_ge!(a, b)`
// https://docs.rs/assertables/…/assertables/macro.assert_len_ge.html
// a label: `a`,
// a debug: `\"x\"`,
// a.len(): `1`",
// b label: `b`,
// b debug: `\"xx\"`,
// b.len(): `2`"