You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Some shrinkers only try a few possibles values: for instance the default shrinker for integers try to divide the integer by 2, but if that fails, it doesn't try further. One example of problematic behavior is the following:
let test =QCheck.Test.make ~count:1000~name:"mod3"QCheck.int (funi -> i mod3<>0);;
which results in:
QCheck_runner.run_tests [test];;
random seed: 275954313
--- Failure --------------------------------------------------------------------
Test mod3 failed (0 shrink steps):
-4393318161250674747
================================================================================
failure (1 tests failed, 0 tests errored, ran 1 tests)
giving a very non-minimal counter-example, instead of the obvious 0, because shrinking failed at the first step.
I think shrinkers should always cover the totality of smaller values, using a 'smart' ordering, much like what is done in the case of lists and arrays (where all sub-lists are tried). So I think the integer shrinker (and possibly others) should probably be fixed, unless there is a compelling argument not to do it ?
The text was updated successfully, but these errors were encountered:
Some shrinkers only try a few possibles values: for instance the default shrinker for integers try to divide the integer by 2, but if that fails, it doesn't try further. One example of problematic behavior is the following:
which results in:
giving a very non-minimal counter-example, instead of the obvious
0
, because shrinking failed at the first step.I think shrinkers should always cover the totality of smaller values, using a 'smart' ordering, much like what is done in the case of lists and arrays (where all sub-lists are tried). So I think the integer shrinker (and possibly others) should probably be fixed, unless there is a compelling argument not to do it ?
The text was updated successfully, but these errors were encountered: