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

Missing QCheck.Shrink.bool #251

Open
jmid opened this issue Jul 6, 2022 · 1 comment
Open

Missing QCheck.Shrink.bool #251

jmid opened this issue Jul 6, 2022 · 1 comment
Labels
good-first-issue Issue suitable for a new contributor

Comments

@jmid
Copy link
Collaborator

jmid commented Jul 6, 2022

I noticed that QCheck.Shrink is missing a bool combinator.

This should be probably shrink true to false like QCheck2:

qcheck/src/core/QCheck2.ml

Lines 313 to 317 in dd5feb4

let bool : bool t = fun st ->
let false_gen = Tree.pure false in
if RS.bool st
then Tree.Tree (true, Seq.return false_gen)
else false_gen

Finally the bool arbitrary could be extended to use it.

@jmid jmid added the good-first-issue Issue suitable for a new contributor label Jul 6, 2022
@c-cube
Copy link
Owner

c-cube commented Jul 6, 2022

👍 I noticed the same thing last week :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good-first-issue Issue suitable for a new contributor
Projects
None yet
Development

No branches or pull requests

2 participants