Macro expecting::expect_ne

source ·
macro_rules! expect_ne {
    ( $a:expr, $b:expr ) => { ... };
}
Expand description

Expects that a != b; otherwise returns early.

§Examples


fn passing_test() -> Result<()> {
    expect_ne!(1, 2);
    Ok(())
}

fn failing_test() -> Result<()> {
    expect_ne!(1, 1);  // returns early
    Ok(())  // won't be reached
}