I’m happy to announce the 0.24 release of qcheck, qcheck-core, qcheck-alcotest, and qcheck-ounit, along with a 0.6 release of ppx_deriving_qcheck
QCheck is a library for randomized property-based testing, inspired by Haskell’s seminal QuickCheck library. The 0.24 release contains a range of improvements to the integrated shrinking of QCheck2, initially introduced in the 0.18 release. As a consequence, its shrinking algorithms should act more predictably, reduce faster, and report smaller counterexamples. In essence, the 0.24 release is what we hoped 0.18 would be. The release also adds missing result, int32, and int64 combinators, as well as more documentation.
If you’ve previously given QCheck2’s integrated shrinking a spin, I encourage you to try it again with the patched 0.24 release. For new users, the 0.24 release is also a good candidate to check out!
Please share any problems you encounter on the qcheck repo: GitHub - c-cube/qcheck: QuickCheck inspired property-based testing for OCaml.
Full change log:
[qcheck-alcotest] Add an optional speed_level parameter to to_alcotest
Adjust the QCheck2.Gen.list shrinker to produce minimal counterexamples at size 3 too
Replace the QCheck2 OCaml 4 Random.State.split hack with a faster one
Improve the QCheck2.Gen.list shrinker heuristic and utilize the improved shrinker in other QCheck2{list,array,bytes,string,function}* shrinkers
Use split and copy in Random.State underlying QCheck2 to avoid non-deterministic shrinking behaviour
Add missing documentation strings for QCheck.{Print,Iter,Shrink,Gen} and QCheck2.Gen.
Add result combinators to QCheck, QCheck.{Gen,Print,Shrink,Observable}, and QCheck2.{Gen,Print,Observable}.
Add missing combinators QCheck{,2}.Print.int{32,64}, QCheck.Gen.int{32,64}, QCheck{,2}.Observable.int{32,64}, and deprecate QCheck.Gen.{ui32,ui64}
FYI, QCheck 0.25 is now available from the opam repository
The 0.25 release contains a combination of all-round fixes, documentation, and polishing:
Restore Test.make’s max_fail parameter which was accidentally broken in 0.18
Adjust stats computation of average and standard deviation to limit precision loss, print both using scientific notation, and workaround MinGW float printing to also pass expect tests
Fix dune snippets missing a language specifier in README.adoc causing asciidoc to error
Add a note to QCheck{,2.Gen}.small_int_corners and QCheck{,2}.Gen.graft_corners about internal state, and fix a range of documentation reference warnings
Reorganize and polish the README, rewrite it to use qcheck-core, and add a QCheck2 integrated shrinking example
Document QCHECK_MSG_INTERVAL introduced in 0.20
Add QCheck{,2}.Gen.map{4,5} combinators
The accompanying ppx_deriving_qcheck.0.7 release offers:
Support ppxlib.0.36.0 based on the OCaml 5.2 AST
Thanks to @Pat-Lafon and @patricoferris for contributing PRs!
QCheck 0.26 is now available from your favorite opam repository!
The 0.26 release adjusts the QCheck and QCheck2float generator distributions, which was previously confined to a subset of floating point numbers. Users may experience that existing tests known to pass start to fail with the new and broader distribution. In addition the release contains a number of other fixes and documentation improvements, incl. the removal of an annoying newline which would cause the test suite to fail on OCaml 5.4.0:
Align printed collect statistics and also add a percentage
Fix QCheck{,2}.Gen.float generator which would only generate numbers with an exponent between 2^{-21} and 2^{22}
Elaborate on the QCheck/QCheck2 situation in the README
Add a missing description field to the *.opam files
Document Shrink invariants in the QCheck module
Fix a qcheck-ounit test suite failure on OCaml 5.4, removing a needless extra newline
Fix QCheck2float_range operator which would fail on negative bounds
Fix QCHECK_MSG_INTERVAL not being applied to the first in-progress message