Macro assertables::assert_lt
source · macro_rules! assert_lt { ($a:expr, $b:expr $(,)?) => { ... }; ($a:expr, $b:expr, $($message:tt)+) => { ... }; }
Expand description
Assert a value is less 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 = 1;
let b = 2;
assert_lt!(a, b);
let a = 2;
let b = 1;
assert_lt!(a, b);
// assertion failed: `assert_lt!(a, b)`
// https://docs.rs/assertables/8.7.0/assertables/macro.assert_lt.html
// a label: `a`,
// a debug: `2`,
// b label: `b`,
// b debug: `1`