|
1 | 1 | const assert = require('assert');
|
2 | 2 | const partOne = require('./partOne');
|
3 |
| -// const partTwo = require('./partTwo'); |
| 3 | +const partTwo = require('./partTwo'); |
4 | 4 |
|
5 |
| -describe('Part 1', () => { |
6 |
| - it('should properly calculate 1122', () => { |
7 |
| - assert.equal(3, partOne('1122')); |
8 |
| - }); |
| 5 | +describe('Day 1: Inverse Captcha', () => { |
| 6 | + describe('Part 1', () => { |
| 7 | + it('should evaluate captcha 1122', () => { |
| 8 | + assert.equal(3, partOne([1, 1, 2, 2])); |
| 9 | + }); |
9 | 10 |
|
10 |
| - it('should properly calculate 1111', () => { |
11 |
| - assert.equal(4, partOne('1111')); |
12 |
| - }); |
| 11 | + it('should evaluate captcha 1111', () => { |
| 12 | + assert.equal(4, partOne([1, 1, 1, 1])); |
| 13 | + }); |
13 | 14 |
|
14 |
| - it('should properly calculate 1234', () => { |
15 |
| - assert.equal(0, partOne('1234')); |
16 |
| - }); |
| 15 | + it('should evaluate captcha 1234', () => { |
| 16 | + assert.equal(0, partOne([1, 2, 3, 4])); |
| 17 | + }); |
17 | 18 |
|
18 |
| - it('should properly calculate 91212129', () => { |
19 |
| - assert.equal(9, partOne('91212129')); |
| 19 | + it('should evaluate captcha 91212129', () => { |
| 20 | + assert.equal(9, partOne([9, 1, 2, 1, 2, 1, 2, 9])); |
| 21 | + }); |
20 | 22 | });
|
21 | 23 |
|
22 |
| -}); |
| 24 | + describe('Part 2', () => { |
| 25 | + it('should evaluate captcha 1212', () => { |
| 26 | + assert.equal(6, partTwo([1, 2, 1, 2])); |
| 27 | + }); |
23 | 28 |
|
24 |
| -// describe('Part 2', () => { |
25 |
| - // it('should properly calculate 1212', () => { |
26 |
| - // assert.equal(6, partTwo('1212')); |
27 |
| - // }); |
| 29 | + it('should evaluate captcha 1221', () => { |
| 30 | + assert.equal(0, partTwo([1, 2, 2, 1])); |
| 31 | + }); |
28 | 32 |
|
29 |
| - // it('should properly calculate 1221', () => { |
30 |
| - // assert.equal(0, partTwo('1221')); |
31 |
| - // }); |
| 33 | + it('should evaluate captcha 123425', () => { |
| 34 | + assert.equal(4, partTwo([1, 2, 3, 4, 2, 5])); |
| 35 | + }); |
32 | 36 |
|
33 |
| - // it('should properly calculate 123425', () => { |
34 |
| - // assert.equal(4, partTwo('123425')); |
35 |
| - // }); |
| 37 | + it('should evaluate captcha 123123', () => { |
| 38 | + assert.equal(12, partTwo([1, 2, 3, 1, 2, 3])); |
| 39 | + }); |
36 | 40 |
|
37 |
| - // it('should properly calculate 123123', () => { |
38 |
| - // assert.equal(12, partTwo('123123')); |
39 |
| - // }); |
40 |
| - |
41 |
| - // it('should properly calculate 12131415', () => { |
42 |
| - // assert.equal(4, partTwo('12131415')); |
43 |
| - // }); |
44 |
| -// }); |
| 41 | + it('should evaluate captcha 12131415', () => { |
| 42 | + assert.equal(4, partTwo([1, 2, 1, 3, 1, 4, 1, 5])); |
| 43 | + }); |
| 44 | + }); |
| 45 | +}); |
0 commit comments