Skip to content

Commit

Permalink
Add explanation for Arbitrary on static primes
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeyBF committed Aug 22, 2024
1 parent 836d81c commit f022087
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ext/crates/fp/src/prime/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ macro_rules! def_prime_static {

fn arbitrary_with(_max: Self::Parameters) -> Self::Strategy {
// This doesn't honor the max parameter, but that should be fine as long as the
// static primes are small enough and/or the max is large enough.
// static primes are small enough and/or the max is large enough. There's no such
// thing as an empty strategy, so the best we could do is return a strategy that
// always rejects. This would cause local failures that may make tests fail.
proptest::strategy::Just($pn)
}
}
Expand Down

0 comments on commit f022087

Please sign in to comment.