2021: day06: tests

This commit is contained in:
Antoine Martin 2021-12-06 11:24:54 +01:00
parent bdc5a25d43
commit 0e4c121ebd
2 changed files with 26 additions and 1 deletions

View file

@ -0,0 +1 @@
3,4,3,1,2

View file

@ -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);
}
}