I am happy to announce a first release of Popper — an OCaml testing library for writing simple unit tests as well as property-based tests, using a uniform API.
A few things that distinguishes Popper from other property-based testing libraries:
- Generic shrinking — when a property-based test fails, the test function attempts to shrink the sample data. This works for any data type.
- Any invariants used when constructing samples for property-based tests are also respected when shrinking.
- There is a ppx for automatically deriving sample functions (generators in QuickCheck style libs) for custom data types.
The library also supports bundling and nesting tests arbitrarily, colorful output inspired by Alcotest, logging facilities and timing info.
Here are some starting points:
This is a first release and there are few work-in-progress items. For instance:
- A CLI for filtering and sorting tests.
- An API for better blending with Lwt code bases.
- A better way for limiting shrinking times for failing test samples.
Any suggestions or other feedback is much appreciated!