advent-of-code-2023/src/day_three.test.ts

27 lines
606 B
TypeScript
Raw Permalink Normal View History

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);
});
});