pub trait PropertyTestable {
type Operation: Debug + Clone;
// Required methods
fn generate_operation(&self, rng: &mut DeterministicRng) -> Self::Operation;
fn apply_operation(&mut self, op: &Self::Operation, clock: &SimClock);
fn check_invariants(&self) -> Result<(), String>;
// Provided method
fn describe_state(&self) -> String { ... }
}Expand description
Trait for systems that can be property-tested.
TigerStyle: Explicit operation generation and invariant checking.
Required Associated Types§
Required Methods§
Sourcefn generate_operation(&self, rng: &mut DeterministicRng) -> Self::Operation
fn generate_operation(&self, rng: &mut DeterministicRng) -> Self::Operation
Generate a random operation based on current state.
The operation should be valid for the current state.
Sourcefn apply_operation(&mut self, op: &Self::Operation, clock: &SimClock)
fn apply_operation(&mut self, op: &Self::Operation, clock: &SimClock)
Apply an operation to the state.
May use the clock for time-dependent operations.
Sourcefn check_invariants(&self) -> Result<(), String>
fn check_invariants(&self) -> Result<(), String>
Check that all invariants hold.
Returns Ok(()) if all invariants pass, Err(message) otherwise.
Provided Methods§
Sourcefn describe_state(&self) -> String
fn describe_state(&self) -> String
Optional: Describe the current state for debugging.