100-days-of-rust/Week-07/Day-45_Subtract-The-Swapped-Bits-Without-Temp-Storage/day45/tests/examples.rs

25 lines
424 B
Rust
Raw Normal View History

2024-09-08 09:26:30 +00:00
#[cfg(test)]
mod examples {
use day45::xor;
#[test]
fn test_example() {
assert_eq!(xor(&mut 10, &mut 41), 31);
}
#[test]
fn test_example2() {
assert_eq!(xor(&mut 69, &mut 420), 351);
}
#[test]
fn test_example3() {
assert_eq!(xor(&mut 12345, &mut 890412), 878067);
}
#[test]
fn test_example4() {
assert_eq!(xor(&mut 2, &mut 1), -1);
}
}