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

use property based testing #718

Closed
wants to merge 2 commits into from
Closed

use property based testing #718

wants to merge 2 commits into from

Conversation

zemse
Copy link
Collaborator

@zemse zemse commented Dec 9, 2024

Works towards #687

let b: u32 = rng.gen();
verify::<SltuOp>("random 1", a, b, (a < b) as u32);
verify::<SltuOp>("random 2", b, a, (a >= b) as u32);
proptest::proptest!(|(a in any::<u32>(), b in any::<u32>())| {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Thanks for taking this on!

Please see #667 for something similar.

The main difference is any::<u32> picks from all u32 uniformly at random, but that PR is slightly more clever about the sampling.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Oh I missed looking at that, sorry

Copy link
Collaborator

Choose a reason for hiding this comment

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

No worries. I didn't advertise enough, I guess.

@matthiasgoergens
Copy link
Collaborator

Closes #687

I'd like that issue to cover all uses of random generation in our tests, not just this particular example, please.

@zemse zemse closed this Dec 10, 2024
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.

2 participants