Skip to main content

Module expect

Module expect 

Source
Expand description

Fluent assertions — Pest’s expect() translated to Rust.

use anvilforge::assay::*;

expect(2 + 2).to_be(4);
expect("hello world").to_contain("world");
expect(vec![1, 2, 3]).to_have_length(3);
expect(Some(5)).to_be_some();
expect(value).not().to_be(0);

Two top-level types: Expect<T> (positive form) and Not<T> (negated form, returned by .not()). Both implement the same set of matchers, but the Not<T> versions invert the assertion. Every matcher returns self so they can chain.

Structs§

Expect
Not

Functions§

expect