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.
Pseudocode:
a > b
-
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)`
// https://docs.rs/assertables/8.7.0/assertables/macro.assert_gt.html
// a label: `a`,
// a debug: `1`,
// b label: `b`,
// b debug: `2`