Macro assertables::assert_gt
source · macro_rules! assert_gt { ($a:expr, $b:expr $(,)?) => { ... }; ($a:expr, $b:expr, $($message:tt)+) => { ... }; }
Expand description
Assert a value is greater than an expression.
-
If true, return
(). -
Otherwise, call
panic!with a message and the values of the expressions with their debug representations.
§Examples
let a = 2;
let b = 1;
assert_gt!(a, b);
let a = 1;
let b = 2;
assert_gt!(a, b);
// assertion failed: `assert_gt!(a, b)`
// a label: `a`,
// a debug: `1`,
// b label: `b`,
// b debug: `2`,
// a: `1`,
// b: `2`