Module sample_test::tester
source · Expand description
Test utilities for sample_std::Sample
.
It is a direct port of quickcheck::QuickCheck
, with some key differences:
- We use the
Debug
impl of tuples whose parts implDebug
. This means we can create a single generalTestable::shrink
definition. - We use an iterative shrinking process instead of a recursive one (see
Testable::shrink
). This allows us to halt after a fixed number of shrinking steps, which sidesteps accidental infinite shrinking implementations and avoids the potential for stack overflows.
Structs§
- The main SampleTest type for setting configuration and running sample-based testing.
- Describes the status of a single instance of a test.
Traits§
Testable
describes types (e.g., a function) whose values can be tested.
Functions§
- Convenience function for running SampleTest.