pub struct EvalCase<Setup, Expect> {
pub name: String,
pub instruction: String,
pub setup: Setup,
pub expect: Vec<Expect>,
}Expand description
One eval case: a named instruction, the world it runs in (Setup), and the predicates
(Expect) its result must satisfy.
Generic over the host’s two domain types:
Setup: how to build the world the case runs against (the input tocrate::Harness::setup).Expect: a single predicate scored against the post-run world (bycrate::Scorer::score).
A case PASSES iff EVERY one of its expect predicates holds (and the run did not error); each
predicate’s pass/fail is also recorded individually for debugging (see crate::report::CaseOutcome).
Fields§
§name: StringStable case name (also used in the report). Conventionally matches the file stem.
instruction: StringThe natural-language instruction handed to the harness verbatim (the user turn).
setup: SetupHow to build the world the case runs against.
#[serde(default)] lets a case omit setup entirely and get Setup::default() — so this
requires Setup: Default at deserialization time (RON only; the in-memory struct has no such
bound).
expect: Vec<Expect>The predicates the result must satisfy (ALL must hold for the case to pass).