Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.18 max_fail regression #182

Open
jmid opened this issue Sep 22, 2021 · 1 comment
Open

0.18 max_fail regression #182

jmid opened this issue Sep 22, 2021 · 1 comment

Comments

@jmid
Copy link
Collaborator

jmid commented Sep 22, 2021

Consider this max_fail example from the documentation https://c-cube.github.io/qcheck/0.18/qcheck-core/QCheck/index.html
(which says "The 15 smallest counter-example lists will be printed" 😉):

With QCheck 0.17 three counterexamples are printed as expected:

utop # let test = QCheck.(
          Test.make
            ~count:10_000 ~max_fail:3
            (list small_nat)
            (fun l -> l = List.sort compare l));;
val test : Test.t = QCheck.Test.Test <abstr>
utop # QCheck.Test.check_exn test;;
Exception:
test `anon_test_1` failed on3 cases:
[1; 0] (after 27 shrink steps)
[1; 0] (after 16 shrink steps)
[1; 0] (after 13 shrink steps)

With QCheck 0.18 we only get one counterexample printed unfortunately - a regression:

utop # let test = QCheck.(
          Test.make
            ~count:10_000 ~max_fail:3
            (list small_nat)
            (fun l -> l = List.sort compare l));;
val test : Test.t = QCheck2.Test.Test <abstr>
utop # QCheck.Test.check_exn test;;
Exception:
test `anon_test_1` failed on1 cases: [1; 0] (after 13 shrink steps)

We should probably add a test for this case... 😉
... or consider using mdx to ensure that the documentation's examples continue to work as intended.

@c-cube
Copy link
Owner

c-cube commented Sep 22, 2021

mdx is cool, but having a unit test is always less flimsy :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants