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
Debugimpl of tuples whose parts implDebug. This means we can create a single generalTestable::shrinkdefinition. - 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
Testabledescribes types (e.g., a function) whose values can be tested.
Functions
- Convenience function for running SampleTest.