factor::numeric::gcd: Add explicit test for the 0 case

This commit is contained in:
nicoo
2020-09-03 14:56:14 -05:00
committed by Roy Ivy III
parent c11cebc4d3
commit 07eaa7fe5a
+4
View File
@@ -72,6 +72,10 @@ mod tests {
gcd(1, a) == 1
}
fn zero(a: u64) -> bool {
gcd(0, a) == a
}
fn divisor(a: u64, b: u64) -> bool {
// Test that gcd(a, b) divides a and b
let g = gcd(a, b);