mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
fixup! factor: Add test exhibiting a bug in ρ
This commit is contained in:
parent
9fe3de72f2
commit
45a1408fb0
1 changed files with 5 additions and 0 deletions
|
@ -159,8 +159,13 @@ mod tests {
|
|||
|
||||
#[test]
|
||||
fn factor_recombines_strong_pseudoprime() {
|
||||
// This is a strong pseudoprime (wrt. miller_rabin::BASIS)
|
||||
// and triggered a bug in rho::factor's codepath handling
|
||||
// miller_rabbin::Result::Composite
|
||||
let pseudoprime = 17179869183;
|
||||
for _ in 0..20 {
|
||||
// Repeat the test 20 times, as it only fails some fraction
|
||||
// of the time.
|
||||
assert!(factor(pseudoprime).product() == pseudoprime);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue