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