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

Test2::Bundle::Extended -no_srand not honored #195

Closed
atoomic opened this issue Oct 30, 2019 · 1 comment
Closed

Test2::Bundle::Extended -no_srand not honored #195

atoomic opened this issue Oct 30, 2019 · 1 comment

Comments

@atoomic
Copy link
Contributor

atoomic commented Oct 30, 2019

This is probably directly a consequence of having srand called on extra time as described from #194 but as you can see when calling multiple times (in the same day), that one-liner, it will always return the same integer, which shows that srand is set whereas we expect to disable it...

╰─> perl -E 'use Test2::Bundle::Extended -no_srand; say int(rand(2**31))'
1522918509
╰─> perl -E 'use Test2::Bundle::Extended -no_srand; say int(rand(2**31))'
1522918509
@atoomic
Copy link
Contributor Author

atoomic commented Oct 30, 2019

It seems that we are loading use Test2::Plugin::SRand(); too early

atoomic added a commit to atoomic/Test2-Suite that referenced this issue Oct 30, 2019
Resolves Test-More#195

When -no_srand is passed as an argument we should
check for 'defined' and not use the return value
of delete which returns the value for it, 'undef'
as default.
atoomic added a commit to atoomic/Test2-Suite that referenced this issue Oct 30, 2019
exodist added a commit that referenced this issue Oct 30, 2019
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

No branches or pull requests

1 participant