c-cube / qcheck

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

Provide `Test` setters #138

Open sir4ur0n opened 3 years ago

sir4ur0n commented 3 years ago

We should probably provide setters for fields of QCheck.Test.t and QCheck.Test.cell where applicable, e.g. set_count.

What do you think?

c-cube commented 3 years ago

what's the use case? Why is count not set when the test is built?

sir4ur0n commented 3 years ago

My current use case was to circumvent https://github.com/c-cube/qcheck/issues/137 by setting the count after the fact in one place (as we have a wrapping function used everywhere to convert QCheck tests into Alcotest tests).

I admit I currently don't have others, but I also don't see a reason not to expose those :sweat_smile:

c-cube commented 3 years ago

you could already use a global reference and use ~count:!myref everywhere, that's simpler :p

c-cube commented 3 years ago

If you really need it I guess we can add it. for count and long.