Module lib::assert_fn_err::assert_fn_err_eq_expr

source ·
Expand description

Assert a function Err(…) is equal to an expression.

Pseudocode:
(function(param) ⇒ Err(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)),
    }
}

§Module macros