c-cube / qcheck

QuickCheck inspired property-based testing for OCaml.
https://c-cube.github.io/qcheck/
BSD 2-Clause "Simplified" License
345 stars 37 forks source link

count cannot be zero #254

Closed vbgl closed 2 years ago

vbgl commented 2 years ago

In 0.19 (since #220), the ~count argument to Test.make can no longer be zero.

Why?

Is this documented?

Using a zero count can be used to disable a test. Real-life use: https://github.com/andrenth/ocaml-stdint/blob/0.7.0/tests/stdint_test.ml#L6

vch9 commented 2 years ago

Ah, I did not see the use case.

vch9 commented 2 years ago

The correct modification should forbid negative counts (and long factors). I fixed the issue in https://github.com/c-cube/qcheck/pull/255

jmid commented 2 years ago

This was an unintended regression. I'll try rolling out a patched 0.19.1 later today or tomorrow.

vbgl commented 2 years ago

That was (very) fast! Thank you all.