pub trait ValueTree<T> {
// Required methods
fn current(&self) -> T;
fn simplify(&mut self) -> bool;
fn complicate(&mut self) -> bool;
}Expand description
A single generated value that can be shrunk toward a simpler one.
After a failing case the runner calls simplify to get a
smaller candidate; if a candidate shrank so far it stopped failing, the
runner calls complicate to walk back. Together they
binary-search toward a minimal counterexample.
Required Methods§
Sourcefn simplify(&mut self) -> bool
fn simplify(&mut self) -> bool
Replaces the current value with a simpler one. Returns true if it
moved, false if the value is already as simple as the tree can make
it.
Sourcefn complicate(&mut self) -> bool
fn complicate(&mut self) -> bool
Walks back toward the last value that still failed, undoing a
simplify that shrank past the failure. Returns
true if it moved.