Expand description
The eight built-in assertions (spec 003).
One shared implementation, the way crate::steps is one shared
implementation. Before this module ExecutionContext::evaluate_assertion
was a required trait method with no in-tree body outside a test double, so
every execution mode was free to answer differently; now they share this and
harness/corpus/assertion_cases.json measures it.
| Type | Reads | Detail |
|---|---|---|
output_contains | raw_output | contains <repr> |
output_not_contains | raw_output | does not contain <repr> |
screen_contains | screen | contains <repr> |
screen_not_contains | screen | does not contain <repr> |
exit_code | exit_code | expected <str>, got <str> |
file_exists | the filesystem | the resolved path |
file_contains | the filesystem | contains <repr> |
json_schema | raw_output | one of nine (FR-016) |
Nothing here can end a run. FR-020 supersedes the oracle, which raises
out of evaluate_assertions on eight different malformed inputs and
discards every result already collected. Each of those becomes a failed
AssertionResult instead, so a report is never truncated by an earlier
assertion — a partial report is worse than none.
Constants§
- BUILTIN_
TYPES - The assertion types this crate answers for, in the order the config declares them.
Functions§
- builtin_
registry - The built-in registry, for a caller that needs to know whether a name is claimed before dispatching (FR-024).
- evaluate
- Evaluate one assertion.
- evaluate_
all - Evaluate every assertion a recipe declares, including the synthetic one.
- evaluated_
list - The assertions a recipe evaluates, in order (FR-019).
- score
- The score a set of assertion results earns (FR-022): the fraction that
passed, and
1.0when there are none to fail.