Add test for day 20
This commit is contained in:
parent
43d232d924
commit
64e851cd77
|
@ -95,6 +95,14 @@ mod tests {
|
||||||
use super::*;
|
use super::*;
|
||||||
use aoc2021::*;
|
use aoc2021::*;
|
||||||
|
|
||||||
|
const TEST_INPUT: &str = "#.#.#..#####.#.#.#.###.##.....###.##.#..###.####..#####..#....#..#..##..###..######.###...####..#..#####..##..#.#####...##.#.#..#.##..#.#......#.###.######.###.####...#.##.##..#..#..#####.....#.#....###..#.##......#.....#..#..#..##..#...##.######.####.####.#.#...#.......#..#.#.#...####.##.#......#..#...##.#.##..#...##.#.##..###.#......#.#.......#.#.#.####.###.##...#.....####.#..#..#.##.#....##..#.####....##...##..#...#......#.#.......#.......##..####..#...#.#.#...##..#.#..###..#####........#..####......#...
|
||||||
|
|
||||||
|
#..#.
|
||||||
|
#....
|
||||||
|
##..#
|
||||||
|
..#..
|
||||||
|
..###";
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn lookup_index_test() {
|
fn lookup_index_test() {
|
||||||
let grid = HashGrid::from_bytes_2d("...\n#..\n.#.", Pixel::from);
|
let grid = HashGrid::from_bytes_2d("...\n#..\n.#.", Pixel::from);
|
||||||
|
@ -103,7 +111,7 @@ mod tests {
|
||||||
assert_eq!(idx, 34);
|
assert_eq!(idx, 34);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Can’t meaningfully test because test and real behaves completely differently toward infinity
|
test!(part1() == 24);
|
||||||
bench!(part1() == 5503);
|
bench!(part1() == 5503);
|
||||||
bench!(part2() == 19156);
|
bench!(part2() == 19156);
|
||||||
bench_input!(|(_, g): &Parsed| g.len() => 10_000);
|
bench_input!(|(_, g): &Parsed| g.len() => 10_000);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user