Module lib::assert_fn_ok::assert_fn_ok_gt

source ·
Expand description

Assert a function Ok(…) is greater than another.

Pseudocode:
(function1(param1) ⇒ Ok(a) ⇒ a) > (function2(param2) ⇒ Ok(b) ⇒ b)

§Example

use assertables::*;
fn f(i: i8) -> Result<String, String> {
    match i {
        0..=9 => Ok(format!("{}", i)),
        _ => Err(format!("{:?} is out of range", i)),
    }
}

let a: i8 = 2;
let b: i8 = 1;
assert_fn_ok_gt!(f, a, f, b);

§Module macros