pub struct TestDef {
pub name: Arc<str>,
pub params: Vec<(VarId, Arc<str>, Ty)>,
pub clauses: Vec<Clause>,
pub bindings: Bindings,
pub span: Span,
}Expand description
A checked test or property block.
Fields§
§name: Arc<str>§params: Vec<(VarId, Arc<str>, Ty)>Non-empty for a property: the inputs a generator supplies (§21.3 rule 5).
clauses: Vec<Clause>§bindings: BindingsThe variables state, events and result are bound to while the expectations run.
span: SpanImplementations§
Source§impl TestDef
impl TestDef
pub fn is_property(&self) -> bool
Sourcepub fn cores_mut(&mut self) -> Vec<&mut Core>
pub fn cores_mut(&mut self) -> Vec<&mut Core>
Every expression this test evaluates, to be annotated in place.
A test block’s expressions are code, and the three passes that annotate a finished
program — crate::liveness, crate::frames and crate::fields — reach them through
here. They did not until 79: all three
walked Program::defs, a test’s clauses are not in it, and so every expression inside a
test block ran on the paths those passes exist to replace.
A clause that names something rather than computing it — expect place(charge) == server,
expect no net.out — contributes nothing, because there is no expression to annotate.
Sourcepub fn is_static_only(&self) -> bool
pub fn is_static_only(&self) -> bool
Every assertion that needs no execution — placement, flow, wire compatibility.
§21.2: “These are compile-time queries, not runtime assertions — beck test answers them
without running anything, from the same data beck explain place and beck check --wire-compat already produce.”