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

Adds unit tests to assure randomness #770

Merged
merged 4 commits into from
Nov 8, 2024
Merged

Conversation

hobnob
Copy link
Member

@hobnob hobnob commented Oct 7, 2024

Tests now run 3 lots of 200,000,000 rolls of dice and check the distribution of the results in order to test the assertion made in #750

There's a minor code cleanup here too, but nothing breaking (just re-using a method rather than having 2 similar methods)

@davesmith00000
Copy link
Member

There's a lot of good stuff in here that I don't want to lose, however there are two points to have another think about:

  1. The discussion on the issue has continued and needs review.
  2. I'm not sure about the Date change made here.

Dice are supposed to be 'predicatably unpredicatable'. By salting the seed with the initial date, I feel like we lose a bit of that. Now, I don't know in practice if it makes a great deal of difference: Is anyone really testing that way? Seems unlikely, but I'm also not sure if adding the date will improve the issue being reported. If not then it's an arbitrary change we don't need.

@davesmith00000
Copy link
Member

Branch needs a rebase.

@hobnob
Copy link
Member Author

hobnob commented Nov 8, 2024

Done :)

Copy link
Member

@davesmith00000 davesmith00000 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One change to make then I'm happy to merge. Thanks.

@davesmith00000 davesmith00000 merged commit b9ac0ed into main Nov 8, 2024
2 checks passed
@davesmith00000 davesmith00000 deleted the bugfix/randomGen branch November 8, 2024 14:33
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.

rollRange under certain circumstances very likely to return the same result
2 participants