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

Add tests to verify that our SplitMix/Seed avoids pathological γ-values #207

Merged
merged 1 commit into from
Jul 5, 2018

Conversation

moodmosaic
Copy link
Member

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

-- https://github.com/hedgehogqa/haskell-hedgehog/issues/191
--
prop_avoid_pathological_gamma_values :: Property
prop_avoid_pathological_gamma_values =
Copy link
Member

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

Copy link
Member Author

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.

@moodmosaic
Copy link
Member Author

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.

@thumphries thumphries merged commit 7516d04 into hedgehogqa:master Jul 5, 2018
@thumphries
Copy link
Member

Thanks!

@moodmosaic moodmosaic deleted the topic/seed-tests branch July 5, 2018 09:39
data Assert =
Assert {
expected :: !Seed
, actual :: !Seed
Copy link
Member Author

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

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

Successfully merging this pull request may close these issues.

None yet

2 participants