-
Notifications
You must be signed in to change notification settings - Fork 109
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
Add tests to verify that our SplitMix/Seed avoids pathological γ-values #207
Conversation
-- https://github.com/hedgehogqa/haskell-hedgehog/issues/191 | ||
-- | ||
prop_avoid_pathological_gamma_values :: Property | ||
prop_avoid_pathological_gamma_values = |
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 looks fully deterministic to me, is that the case?
If so, we don't need to run this 100 times.
Suggest something like
withTests 1 . property $ do
for asserts $ \a ->
expected a === actual a
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.
Indeed, those are deterministic, so just doing the comparison once is enough. Good catch 👍 Fixed and force-pushed.
b45c319
to
0f4f45c
Compare
Hmm, not sure why 1 of the 2 Travis CI checks fails. I think it's because I forced pushed the branch to the wrong origin, and then I forced pushed to the right one. |
As discussed by Melissa E. O'Neill in 'Bugs in SplitMix(es)' at http://www.pcg-random.org/posts/bugs-in-splitmix.html
0f4f45c
to
1f14eee
Compare
Thanks! |
data Assert = | ||
Assert { | ||
expected :: !Seed | ||
, actual :: !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.
Ugh! I forgot we're strict with no alignment anywhere (look at line 14). Happy to clean this up if you wish. /cc @jystic @thumphries
We were missing the test part in Haskell, which is pretty similar to what we did in F#. See Melissa E. O'Neill's post with title Bugs in SplitMix(es), #191, and 39b15b9, for more context.
/cc @jystic @thumphries