pub fn eq<T>(expected: T) -> impl Matcher<T>Expand description
Matches a value equal to expected.
On a mismatch where the values’ pretty representations are multi-line (a struct, a collection), the failure carries a line-oriented diff.
use test_better_core::TestResult;
use test_better_matchers::{eq, check};
fn main() -> TestResult {
check!(2 + 2).satisfies(eq(4))?;
check!(5).violates(eq(4))?;
Ok(())
}