pub struct TestRunner { /* private fields */ }
Expand description

State used when running a proptest test.

Implementations

Create a fresh TestRunner with the given configuration.

The runner will use an RNG with a generated seed and the default algorithm.

In no_std environments, every TestRunner will use the same hard-coded seed. This seed is not contractually guaranteed and may be changed between releases without notice.

Create a fresh TestRunner with the standard deterministic RNG.

This is sugar for the following:

let config = Config::default();
let algorithm = config.rng_algorithm;
TestRunner::new_with_rng(
    config,
    TestRng::deterministic_rng(algorithm));

Refer to TestRng::deterministic_rng() for more information on the properties of the RNG used here.

Create a fresh TestRunner with the given configuration and RNG.

Returns the RNG for this test run.

Create a new, independent but deterministic RNG from the RNG in this runner.

Returns the configuration of this runner.

Dumps the bytes obtained from the RNG so far (only works if the RNG is set to Recorder).

Panics

Panics if the RNG does not capture generated data.

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.

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.

This does not honour the fork config, and will not be able to terminate the run if it runs for longer than timeout. However, if the test function returns but took longer than timeout, the test case will fail.

Update the state to account for a local rejection from whence, and return Ok if the caller should keep going or Err to abort.

Increment the counter of flat map regenerations and return whether it is still under the configured limit.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Equivalent to: TestRunner::new(Config::default()).

Returns the “default value” for a type. Read more

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.