Skip to main content

Module assert_fn

Module assert_fn 

Source
Expand description

Assert for comparing functions.

These macros help compare functions that return anything. The macros call the functions, then compare the return values.

Compare a function with another function:

Compare a function with an expression:

§Example

use assertables::*;

let a: i8 = -1;
let b: i8 = 1;
assert_fn_eq!(i8::abs, a, i8::abs, b);

Modules§

assert_fn_eq
Assert a function output is equal to another.
assert_fn_eq_x
Assert a function output is equal to an expression.
assert_fn_ge
Assert a function output is greater than or equal to another.
assert_fn_ge_x
Assert a function output is greater than or equal to an expression.
assert_fn_gt
Assert a function output is greater than another.
assert_fn_gt_x
Assert a function output is greater than an expression.
assert_fn_le
Assert a function output is less than or equal to another.
assert_fn_le_x
Assert a function output is less than or equal to an expression.
assert_fn_lt
Assert a function output is less than another.
assert_fn_lt_x
Assert a function output is less than an expression.
assert_fn_ne
Assert a function output is not equal to another.
assert_fn_ne_x
Assert a function output is not equal to an expression.