pub struct FalsificationTest {
pub id: String,
pub rule: String,
pub prediction: String,
pub test: Option<String>,
pub test_harness: Option<String>,
pub name: Option<String>,
pub if_fails: String,
}Expand description
A Popperian falsification test.
Each makes a falsifiable prediction about the implementation. If the prediction is wrong, the test identifies root cause.
Fields§
§id: String§rule: StringWhat the test asserts. Alias description accepted for legacy
pre-APR-MONO contracts that used the description: field name.
name: is NOT aliased because several legacy contracts (e.g.
publish-manifest-v1) ship both name: (a slug) and
description: (prose) side-by-side; aliasing both collapses to
a duplicate field error.
prediction: StringThe predicted outcome if the rule holds. Alias expected accepted
for legacy contracts (e.g. expected: exit 0, expected: "PASS").
Defaulted because diagnostic contracts often encode prediction
inside the rule text alone.
test: Option<String>How to run the test. Alias command accepted for legacy contracts
(e.g. shell snippets under command: |).
test_harness: Option<String>How to run the test, in the test_harness: spelling. 619 entries in
contracts/ use this field INSTEAD of test: — 94 of them holding a
real cargo test invocation, the rest a shell harness (grep -q …,
test -f …, bash …).
#2465: this field did not exist on the struct, and FalsificationTest
is not deny_unknown_fields, so serde dropped it silently. Every one
of those 619 entries reached strict_test_binding with test: None
and was skipped — the gate reported them as neither bound nor broken.
name: Option<String>The bare test-fn name, when the contract names it here rather than in
an invocation. Deliberately NOT a serde alias of rule: several
legacy contracts (e.g. publish-manifest-v1) ship name: (a slug)
and description: (prose) side by side, and aliasing both onto one
field collapses to a duplicate field parse error. Consumed as a
binding source of last resort — see strict_test_binding.
if_fails: StringWhat failure means. Alias fails_if accepted for legacy contracts.
Defaulted because several legacy diagnostic contracts omit it.
Trait Implementations§
Source§impl Clone for FalsificationTest
impl Clone for FalsificationTest
Source§fn clone(&self) -> FalsificationTest
fn clone(&self) -> FalsificationTest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more