generated from mariotacke/template-advent-of-code
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
35 lines (28 loc) · 758 Bytes
/
test.js
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
const assert = require('node:assert');
const part1 = require('./part1');
const part2 = require('./part2');
describe('Day 8: Haunted Wasteland', () => {
it('should calculate number of steps', () => {
const input =
`LLR
AAA = (BBB, BBB)
BBB = (AAA, ZZZ)
ZZZ = (ZZZ, ZZZ)`;
assert.strictEqual(part1(input), 6);
});
describe('Part Two', () => {
it('should calculate number of steps for all routes', () => {
const input =
`LR
11A = (11B, XXX)
11B = (XXX, 11Z)
11Z = (11B, XXX)
22A = (22B, XXX)
22B = (22C, 22C)
22C = (22Z, 22Z)
22Z = (22B, 22B)
XXX = (XXX, XXX)`;
assert.strictEqual(part2(input), 6);
});
});
});