Struct proptest::test_runner::TestRunner
[−]
[src]
pub struct TestRunner { /* fields omitted */ }
State used when running a proptest test.
Methods
impl TestRunner
[src]
pub fn new(config: Config) -> Self
[src]
Create a fresh TestRunner
with the given configuration.
pub fn rng(&mut self) -> &mut XorShiftRng
[src]
Returns the RNG for this test run.
pub fn new_rng(&mut self) -> XorShiftRng
[src]
Create a new, independent but deterministic RNG from the RNG in this runner.
pub fn config(&self) -> &Config
[src]
Returns the configuration of this runner.
pub fn run<S: Strategy, F: Fn(&ValueFor<S>) -> TestCaseResult>(
&mut self,
strategy: &S,
test: F
) -> Result<(), TestError<ValueFor<S>>>
[src]
&mut self,
strategy: &S,
test: F
) -> Result<(), TestError<ValueFor<S>>>
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
.
If failure persistence is enabled, all persisted failing cases are tested first. If a later non-persisted case fails, its seed is persisted before returning failure.
Returns success or failure indicating why the test as a whole failed.
pub fn run_one<V: ValueTree, F: Fn(&V::Value) -> TestCaseResult>(
&mut self,
case: V,
test: F
) -> Result<bool, TestError<V::Value>>
[src]
&mut self,
case: V,
test: 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.
pub fn reject_local<R>(&mut self, whence: R) -> Result<(), Reason> where
R: Into<Reason>,
[src]
R: Into<Reason>,
Update the state to account for a local rejection from whence
, and
return Ok
if the caller should keep going or Err
to abort.
pub fn flat_map_regen(&self) -> bool
[src]
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
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for TestRunner
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Display for TestRunner
[src]
fn fmt(&self, f: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Default for TestRunner
[src]
Equivalent to: TestRunner::new(Config::default())
.