Struct proptest::test_runner::TestRunner
[−]
[src]
pub struct TestRunner { /* fields omitted */ }
State used when running a proptest test.
Methods
impl TestRunner
[src]
fn new(config: Config) -> Self
Create a fresh TestRunner
with the given configuration.
fn rng(&mut self) -> &mut XorShiftRng
Returns the RNG for this test run.
fn config(&self) -> &Config
Returns the configuration of this runner.
fn run<S: Strategy, F: Fn(&<S::Value as ValueTree>::Value) -> TestCaseResult>(
&mut self,
strategy: &S,
f: F
) -> Result<(), TestError<<S::Value as ValueTree>::Value>>
&mut self,
strategy: &S,
f: F
) -> Result<(), TestError<<S::Value as ValueTree>::Value>>
Run test cases against f
, choosing inputs via strategy
.
If any failure cases occur, try to find a minimal failure case and
report that. If invoking f
panics, the panic is turned into a
TestCaseError::Fail
.
Returns success or failure indicating why the test as a whole failed.
fn run_one<V: ValueTree, F: Fn(&V::Value) -> TestCaseResult>(
&mut self,
case: V,
f: F
) -> Result<bool, TestError<V::Value>>
&mut self,
case: V,
f: F
) -> Result<bool, TestError<V::Value>>
Run one specific test case against this runner.
If the test fails, finds the minimal failing test case. If the test does not fail, returns whether it succeeded or was filtered out.
fn reject_local(&mut self, whence: String) -> Result<(), String>
Update the state to account for a local rejection from whence
, and
return Ok
if the caller should keep going or Err
to abort.
fn flat_map_regen(&self) -> bool
Increment the counter of flat map regenerations and return whether it is still under the configured limit.
Trait Implementations
impl Clone for TestRunner
[src]
fn clone(&self) -> TestRunner
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more