claim

Macro claim 

Source
macro_rules! claim {
    ($verdict:expr, $value:expr) => { ... };
}
Expand description

Open a Verdict claim from a local binding or expression. The label is stringify!(<expr-tokens>) so a regression that renames the binding or alters the expression updates the rendered failure message in lock-step.

Use as claim!(verdict, my_local).at_most(N) or claim!(verdict, end - start).at_least(N). For struct fields under a #[derive(Claim)], prefer the typed accessor (verdict.claim_<field>(s)) — the macro is the escape hatch when no derived accessor exists.

Expanded form: verdict.claim(stringify!(expr), expr). The macro is a thin wrapper so Verdict::claim’s 'static label invariant holds (string literals from stringify! always have 'static lifetime).

let mut v = Verdict::new();
let answer = 42u64;
claim!(v, answer).at_least(40);
claim!(v, answer * 2).at_most(100);
let r = v.into_result();
assert!(r.is_pass());