Module lib::assert_ok

source ·
Expand description

Assert macros for Ok(_) items.

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

Assert expression is Ok(_):

Compare Ok(…) to another Ok(…):

Compare Ok(…) to an expression:

§Example

use assertables::*;
 
let a: Result<(), i8> = Ok(());
assert_ok!(a);

Modules§

  • Assert expression is Ok(_).
  • Assert two expressions are Ok(_) and their values are equal.
  • Assert an expression is Ok(_) and its value is equal to an expression.
  • Assert two expressions are Ok(_) and their values are not equal.
  • Assert an expression is Ok(_) and its value is not equal to an expression.