From 64e851cd773bdfd55fe5858d72564bf058598e1f Mon Sep 17 00:00:00 2001 From: kageru Date: Tue, 21 Dec 2021 00:20:34 +0100 Subject: [PATCH] Add test for day 20 --- 2021/src/bin/day20.rs | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/2021/src/bin/day20.rs b/2021/src/bin/day20.rs index be4aa91..6d447a2 100644 --- a/2021/src/bin/day20.rs +++ b/2021/src/bin/day20.rs @@ -95,6 +95,14 @@ mod tests { use super::*; use aoc2021::*; + const TEST_INPUT: &str = "#.#.#..#####.#.#.#.###.##.....###.##.#..###.####..#####..#....#..#..##..###..######.###...####..#..#####..##..#.#####...##.#.#..#.##..#.#......#.###.######.###.####...#.##.##..#..#..#####.....#.#....###..#.##......#.....#..#..#..##..#...##.######.####.####.#.#...#.......#..#.#.#...####.##.#......#..#...##.#.##..#...##.#.##..###.#......#.#.......#.#.#.####.###.##...#.....####.#..#..#.##.#....##..#.####....##...##..#...#......#.#.......#.......##..####..#...#.#.#...##..#.#..###..#####........#..####......#... + +#..#. +#.... +##..# +..#.. +..###"; + #[test] fn lookup_index_test() { let grid = HashGrid::from_bytes_2d("...\n#..\n.#.", Pixel::from); @@ -103,7 +111,7 @@ mod tests { assert_eq!(idx, 34); } - // Can’t meaningfully test because test and real behaves completely differently toward infinity + test!(part1() == 24); bench!(part1() == 5503); bench!(part2() == 19156); bench_input!(|(_, g): &Parsed| g.len() => 10_000);