-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathday16.test.ts
58 lines (52 loc) · 1.25 KB
/
day16.test.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { describe, expect, it } from 'vitest';
import { DayImpl } from './day16.ts';
const first = `###############
#.......#....E#
#.#.###.#.###.#
#.....#.#...#.#
#.###.#####.#.#
#.#.#.......#.#
#.#.#####.###.#
#...........#.#
###.#.#####.#.#
#...#.....#.#.#
#.#.#.###.#.#.#
#.....#...#.#.#
#.###.#.#.#.#.#
#S..#.....#...#
###############`;
const second = `#################
#...#...#...#..E#
#.#.#.#.#.#.#.#.#
#.#.#.#...#...#.#
#.#.#.#.###.#.#.#
#...#.#.#.....#.#
#.#.#.#.#.#####.#
#.#...#.#.#.....#
#.#.#####.#.###.#
#.#.#.......#...#
#.#.###.#####.###
#.#.#...#.....#.#
#.#.#.#####.###.#
#.#.#.........#.#
#.#.#.#########.#
#S#.............#
#################`;
describe('day16', () => {
describe('partOne', () => {
it('should return 7036 for the first example ', () => {
expect(new DayImpl(first).partOne()).toEqual(7036);
});
it('should return 11048 for the second example ', () => {
expect(new DayImpl(second).partOne()).toEqual(11048);
});
});
describe('partTwo', () => {
it('should return 45 for the first example', () => {
expect(new DayImpl(first).partTwo()).toEqual(45);
});
it('should return 64 for the second example', () => {
expect(new DayImpl(second).partTwo()).toEqual(64);
});
});
});