Module assert_fn_ok_ge_x

Source
Expand description

Assert a function Ok(…) is greater than or equal to an expression.

Pseudocode:
(a_function(a_param) ⇒ Ok(a) ⇒ a) ≥ expr

§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 = String::from("1");
assert_fn_ok_ge_x!(f, a, b);

§Module macros