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