sample-test: strategies and machinery for sample testing

Create tests that sample arbitrary data to produce counterexamples for a given proposition.

Prior Work

This library was heavily inspired by quickcheck and proptest.

Here's where it differs:

This library attempts to split the difference. It allows user-defined Sample strategies which are fed into tests. Shrinking, like with quickcheck, operates directly on generated values. This avoids the need to create and maintain the seed tree used by proptest, and allows this library to scale up to larger generated data sizes.

Instead of macros, this library and any downstream users rely heavily on Sample combinators. This is inspired by Iterator composition which is very performant and concise, all without the need for any macros.

The tradeoffs are: