25 lines
424 B
Rust
25 lines
424 B
Rust
#[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);
|
|
}
|
|
}
|