Module 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 impl Debug. This means we can create a single general Testable::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§

SampleTest
The main SampleTest type for setting configuration and running sample-based testing.
TestResult
Describes the status of a single instance of a test.

Traits§

Testable
Testable describes types (e.g., a function) whose values can be tested.

Functions§

sample_test
Convenience function for running SampleTest.