2023-12-03 11:58:21 +00:00
|
|
|
import { Engine } from "./day_three";
|
|
|
|
|
|
|
|
const schematic = `467..114..
|
|
|
|
...*......
|
|
|
|
..35..633.
|
|
|
|
......#...
|
|
|
|
617*......
|
|
|
|
.....+.58.
|
|
|
|
..592.....
|
|
|
|
......755.
|
|
|
|
...$.*....
|
|
|
|
.664.598..`;
|
|
|
|
|
|
|
|
|
|
|
|
// const schematic = `.....+.58.
|
|
|
|
// ..592.....`;
|
|
|
|
|
|
|
|
describe('Day Three', () => {
|
|
|
|
it('should calculate the sum of all part numbers', () => {
|
|
|
|
const engine = Engine.create(schematic);
|
|
|
|
expect(engine.sumPartNumbers()).toEqual(4361);
|
|
|
|
});
|
2023-12-03 12:17:08 +00:00
|
|
|
it('should give the sum of the gear ratios', () => {
|
|
|
|
const engine = Engine.create(schematic, true);
|
|
|
|
expect(engine.gearRatioSums()).toEqual(467835);
|
|
|
|
});
|
2023-12-03 11:58:21 +00:00
|
|
|
});
|