diff --git a/aoc2021/input/day06_provided.txt b/aoc2021/input/day06_provided.txt new file mode 100644 index 0000000..55129f1 --- /dev/null +++ b/aoc2021/input/day06_provided.txt @@ -0,0 +1 @@ +3,4,3,1,2 diff --git a/aoc2021/src/day06.rs b/aoc2021/src/day06.rs index 876252c..f0b6ec4 100644 --- a/aoc2021/src/day06.rs +++ b/aoc2021/src/day06.rs @@ -123,4 +123,28 @@ impl std::str::FromStr for LanternFish { } #[cfg(test)] -mod tests {} +mod tests { + use super::*; + + const PROVIDED: &str = include_str!("../input/day06_provided.txt"); + + #[test] + fn part1_provided() { + assert_eq!(part1(PROVIDED).unwrap(), 5934); + } + + #[test] + fn part1_real() { + assert_eq!(part1(INPUT).unwrap(), 350149); + } + + #[test] + fn part2_provided() { + assert_eq!(part2(PROVIDED).unwrap(), 26984457539); + } + + #[test] + fn part2_real() { + assert_eq!(part2(INPUT).unwrap(), 1590327954513); + } +}