Macro assertables::assume_lt [−][src]
macro_rules! assume_lt { ($left:expr, $right:expr $(,)?) => { ... }; ($left:expr, $right:expr, $($arg:tt)+) => { ... }; }
Expand description
Assume one value is less than another value.
-
When true, return
Ok(true). -
Otherwise, return
Errwith a message and the values of the expressions with their debug representations.
Example
let x = assume_lt!(1, 2); //-> Ok(true)
let x = assume_lt!(2, 1); //-> Err("assumption failed: `assume_lt(left, right)`\n left: `2`\n right: `1`")
This macro has a second form where a custom message can be provided.