[][src]Macro assert_that::assert_that

macro_rules! assert_that {
    ($value:expr, $pred:expr $(,)?) => { ... };
}

Simple macro to make assertions with a better error message.

Examples

use assert_that::assert_that;

assert_that!("Hello World", str::similar("Hello World"));

assert_that!("Hello World", str::diff("Goodbye World"));

// Can be used with more complex predicates
assert_that!(
    &1234,
    ge(-5).and(le(i16::MAX))
);