c-cube / qcheck

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

parametirize string shrinker with a char shrinker #258

Closed n-osborne closed 1 year ago

n-osborne commented 1 year ago

This PR is an attempt to fix #257.

It does so by:

For now, we don't expose a string arbitrary that takes a shrinker as argument. Albeit it would be nice, there is the question of how to do it. I see three possibilities:

  1. add an optional argument to QCheck.string_gen and QCheck.string_gen_of_size
  2. add a non-optional argument to QCheck.string_gen and QCheck.string_gen_of_size
  3. add two functions: QCheck.string_gen_shrink and QCheck.string_gen_shrink_of_size
jmid commented 1 year ago

Short and sweet - LGTM - thanks! :pray: