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