100-days-of-rust/Week-05/Day-34_Primary-Arithmetic/day34/tests/examples.rs

35 lines
599 B
Rust

#[cfg(test)]
mod examples {
use day34::carry_operations;
#[test]
fn example1() {
assert_eq!(carry_operations(123, 456), 0);
}
#[test]
fn example2() {
assert_eq!(carry_operations(555, 555), 3);
}
#[test]
fn example3() {
assert_eq!(carry_operations(123, 594), 1);
}
#[test]
fn example4() {
assert_eq!(carry_operations(555, 545), 3);
}
#[test]
fn example5() {
assert_eq!(carry_operations(1, 20000), 0);
}
#[test]
fn example6() {
assert_eq!(carry_operations(1, 2), 0);
}
}