Add test for day 20

This commit is contained in:
kageru 2021-12-21 00:20:34 +01:00
parent 43d232d924
commit 64e851cd77
Signed by: kageru
GPG Key ID: 8282A2BEA4ADA3D2

View File

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