pub struct ContractReport { /* private fields */ }Expand description
A report containing stable check identities and their outcomes.
This report describes check evidence only. It does not establish that the
contract run completed, that its execution succeeded, or that cleanup
succeeded. Use
ContractRun::assert_satisfied
or ContractRun::assert_satisfied_with
to validate the complete run.
§Examples
use qubit_fs_testkit::{FileSystemContract, FileSystemContractSuite};
let fixture = RustdocSyncFixture::new();
let mut suite = FileSystemContractSuite::new(&fixture);
suite.run_contract(FileSystemContract::Properties);
assert!(!suite.run().report().checks().is_empty());Implementations§
Source§impl ContractReport
impl ContractReport
Sourcepub fn checks(&self) -> &[ContractCheck]
pub fn checks(&self) -> &[ContractCheck]
Returns checks in execution order.
§Returns
The recorded checks in the order their outcomes were produced.
Sourcepub fn requirements_satisfied(&self) -> bool
pub fn requirements_satisfied(&self) -> bool
Returns whether the registered contract requirements have evidence.
An unavailable optional probe is acceptable. A probe that ran and failed
is always a failure, even when it was optional.
This checks report evidence only; it does not include execution or
cleanup status. Use
ContractRun::requirements_satisfied
to check the complete run.
Sourcepub fn requirements_satisfied_with(&self, required: &[ContractCheckId]) -> bool
pub fn requirements_satisfied_with(&self, required: &[ContractCheckId]) -> bool
Also requires evidence for the caller-selected optional checks.
A requested identity absent from this run cannot satisfy the request.
This checks report evidence only; it does not include execution or
cleanup status. Use
ContractRun::requirements_satisfied_with
to check the complete run.
§Parameters
required: Optional check identities that must have evidence.
§Returns
Whether the registered requirements and selected optional checks are satisfied.
Sourcepub fn all_applicable_checks_verified(&self) -> bool
pub fn all_applicable_checks_verified(&self) -> bool
Returns whether every applicable check, including optional probes, was
verified.
This checks report evidence only; it does not include execution or
cleanup status. Use
ContractRun::all_applicable_checks_verified
to check the complete run.
§Returns
Whether all applicable checks have evidence, including optional probes.
Sourcepub fn assert_satisfied(&self)
pub fn assert_satisfied(&self)
Panics if registered requirements lack successful evidence.
This checks report evidence only; it does not include execution or
cleanup status. Use
ContractRun::assert_satisfied
to validate the complete run.
§Panics
Panics with a summary when any registered requirement lacks successful evidence.
Sourcepub fn assert_satisfied_with(&self, required: &[ContractCheckId])
pub fn assert_satisfied_with(&self, required: &[ContractCheckId])
Also requires the selected optional probes to have evidence.
This checks report evidence only; it does not include execution or
cleanup status. Use
ContractRun::assert_satisfied_with
to validate the complete run.
§Panics
Panics when any required check or selected optional probe is unverified.
§Parameters
required: Optional check identities that must have evidence.