-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.js
32 lines (25 loc) · 870 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
const assert = require('assert');
const polymer = require('./polymer');
const polymer2 = require('./polymer2');
describe('Day 5: Alchemical Reduction', () => {
it('should calculate polymer from aA', () => {
assert.strictEqual(polymer('aA'), 0);
});
it('should calculate polymer from abBA', () => {
assert.strictEqual(polymer('abBA'), 0);
});
it('should calculate polymer from abAB', () => {
assert.strictEqual(polymer('abAB'), 4);
});
it('should calculate polymer from aabAAB', () => {
assert.strictEqual(polymer('aabAAB'), 6);
});
it('should calculate polymer from dabAcCaCBAcCcaDA', () => {
assert.strictEqual(polymer('dabAcCaCBAcCcaDA'), 10);
});
describe('Part Two', () => {
it('should calculate polymer from dabAcCaCBAcCcaDA', () => {
assert.strictEqual(polymer2('dabAcCaCBAcCcaDA'), 4);
});
});
});