Skip to main content

expect

Macro expect 

Source
macro_rules! expect {
    ($actual:expr) => { ... };
}
Expand description

Captures an expression and its source text for assertion with a matcher.

use test_better_core::TestResult;
use test_better_matchers::{eq, expect};

fn main() -> TestResult {
    expect!(2 + 2).to(eq(4))?;
    Ok(())
}