diff --git a/src/bin/day01.rs b/src/bin/day01.rs index 883831f..fba0699 100644 --- a/src/bin/day01.rs +++ b/src/bin/day01.rs @@ -78,12 +78,25 @@ fn main() { .compact() .init(); - let sample = parse_input("samples/day01.txt"); let input = parse_input("inputs/day01.txt"); - assert_eq!(part_1(&sample), 24000); info!("Part 1: {}", part_1(&input)); - - assert_eq!(part_2(&sample), 45000); info!("Part 2: {}", part_2(&input)); } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn test_part_1() { + let sample = parse_input("samples/day01.txt"); + assert_eq!(part_1(&sample), 24000); + } + + #[test] + fn test_part_2() { + let sample = parse_input("samples/day01.txt"); + assert_eq!(part_2(&sample), 45000); + } +}