-
Notifications
You must be signed in to change notification settings - Fork 91
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
Regenerate default seed at every prop iteration #124
Conversation
/cc @barambani |
def seed = | ||
scalaCheckTestParameters.initialSeed.getOrElse( | ||
Seed.fromBase64(scalaCheckInitialSeed).get | ||
) | ||
val result = check(scalaCheckTestParameters, prop.useSeed(test.name, seed)) | ||
val result = check( | ||
scalaCheckTestParameters, | ||
Prop(genParams => prop(genParams.withInitialSeed(seed))) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this way if the user hasn't overridden the default seed, we recompute it in the Prop
lambda (which is what viewSeed
does in vanilla ScalaCheck)
Thanks for the fix. This version works for all the tests I had. |
Thanks for confirming and thanks again for the detailed bug report. Having a reproduction test case has been really helpful in tracking this down |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job tracking down the fix! Can we test this with a framework suite?
It’s possible to use println in framework suites just to check that each iteration has a unique value. |
Whoops, I actually had a test suite I forgot to commit 😅 doing it tomorrow |
Done now @olafurpg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 Thank you for tracking this down!
This fix has been released as v0.7.6. Thank you @barambani for reporting! |
Brilliant, Thank you both. |
Fixes #118
This is extremely subtle, but it seems to work now