assertables

Module assert_err

Source
Expand description

Assert for Err(…) items.

These macros help compare Err(…) items, such as ::std::Result::Err or similar.

Assert expression is Err:

Compare Err(…) to another Err(…):

Compare Err(…) to an expression:

§Example

use assertables::*;

let a: Result<i8, i8> = Err(1);
assert_err!(a);

Modules§

  • Assert expression is Err.
  • Assert two expressions are Err and their values are equal.
  • Assert an expression is Err and its value is equal to an expression.
  • Assert two expressions are Err and their values are not equal.
  • Assert an expression is Err and its value is not equal to an expression.