mirror of
https://github.com/PaddiM8/kalker.git
synced 2025-01-07 05:59:03 +01:00
Add tests for LCM
This commit is contained in:
parent
a1b7631735
commit
2fc11f36d8
@ -747,12 +747,14 @@ mod tests {
|
||||
#[test]
|
||||
fn test_binary_funcs() {
|
||||
let in_out = vec![
|
||||
(gcd, ((12f64, 0f64), (18f64, 0f64)), (6f64, 0f64)),
|
||||
(gcd, ((30f64, 0f64), (18f64, 0f64)), (6f64, 0f64)),
|
||||
(gcd, (( 5f64, 0f64), ( 2f64, 1f64)), (2f64, 1f64)),
|
||||
(gcd, ((18f64, 4f64), (30f64, 0f64)), (4f64, 2f64)),
|
||||
(gcd, (( 3f64, 1f64), ( 1f64, -1f64)), (1f64, -1f64)),
|
||||
(gcd, ((12f64, -8f64), ( 6f64, 4f64)), (2f64, 0f64)),
|
||||
(gcd as fn(KalkNum, KalkNum) -> KalkNum, ((12f64, 0f64), (18f64, 0f64)), ( 6f64, 0f64)),
|
||||
(gcd, ((30f64, 0f64), (18f64, 0f64)), ( 6f64, 0f64)),
|
||||
(gcd, (( 5f64, 0f64), ( 2f64, 1f64)), ( 2f64, 1f64)),
|
||||
(gcd, ((18f64, 4f64), (30f64, 0f64)), ( 4f64, 2f64)),
|
||||
(gcd, (( 3f64, 1f64), ( 1f64, -1f64)), ( 1f64, -1f64)),
|
||||
(gcd, ((12f64, -8f64), ( 6f64, 4f64)), ( 2f64, 0f64)),
|
||||
(lcm, ((12f64, -8f64), ( 6f64, 4f64)), (52f64, 0f64)),
|
||||
(lcm, (( 1f64, -2f64), ( 3f64, 1f64)), ( 5f64, -5f64)),
|
||||
];
|
||||
|
||||
for (i, (func, input, expected_output)) in in_out.iter().enumerate() {
|
||||
|
Loading…
Reference in New Issue
Block a user