generated from mariotacke/template-advent-of-code
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.js
64 lines (49 loc) · 1.51 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
const assert = require('assert');
const shuttle = require('./shuttle');
const shuttle2 = require('./shuttle2');
describe('Day 13', () => {
it('should determine time-to-wait and bus ID', () => {
const input =
`939
7,13,x,x,59,x,31,19`;
assert.strictEqual(shuttle(input), 295);
});
describe('Part Two', () => {
it('should determine earliest timestamp aligning to positions (#1)', () => {
const input =
`939
7,13,x,x,59,x,31,19`;
assert.strictEqual(shuttle2(input), 1068781);
});
it('should determine earliest timestamp aligning to positions (#2)', () => {
const input =
`0
17,x,13,19`;
assert.strictEqual(shuttle2(input), 3417);
});
it('should determine earliest timestamp aligning to positions (#3)', () => {
const input =
`0
67,7,59,61`;
assert.strictEqual(shuttle2(input), 754018);
});
it('should determine earliest timestamp aligning to positions (#4)', () => {
const input =
`0
67,x,7,59,61`;
assert.strictEqual(shuttle2(input), 779210);
});
it('should determine earliest timestamp aligning to positions (#5)', () => {
const input =
`0
67,7,x,59,61`;
assert.strictEqual(shuttle2(input), 1261476);
});
it('should determine earliest timestamp aligning to positions (#6)', () => {
const input =
`0
1789,37,47,1889`;
assert.strictEqual(shuttle2(input), 1202161486);
});
});
});