Module lib::assert_fn_ok::assert_fn_ok_ne_expr
source · Expand description
Assert a function Ok(…) is not equal to an expression.
Pseudocode:
(function1(param1) ⇒ Ok(a) ⇒ a) ≠ expr
§Example
fn f(i: i8) -> Result<String, String> {
match i {
0..=9 => Ok(format!("{}", i)),
_ => Err(format!("{:?} is out of range", i)),
}
}
let a: i8 = 1;
let b = String::from("2");
assert_fn_ok_ne_expr!(f, a, b);