2022-12-03 19:52:19 +00:00
|
|
|
import { test, expect, describe } from "vitest";
|
|
|
|
|
2022-12-03 20:26:15 +00:00
|
|
|
import { solutionPart1, sample, puzzleInput } from "./part1.js";
|
|
|
|
|
2022-12-03 19:52:19 +00:00
|
|
|
import { solutionPart2 } from "./part2.js";
|
|
|
|
|
|
|
|
function expectSolution(result) {
|
|
|
|
console.info(result);
|
|
|
|
return expect(result);
|
|
|
|
}
|
|
|
|
|
|
|
|
describe("part 1", () => {
|
2022-12-03 20:26:15 +00:00
|
|
|
test("sample", () => {
|
|
|
|
expect(solutionPart1(sample)).toEqual(157);
|
|
|
|
});
|
2022-12-03 19:52:19 +00:00
|
|
|
test("solution", () => {
|
2022-12-03 20:26:15 +00:00
|
|
|
expectSolution(solutionPart1(puzzleInput)).toEqual(8515);
|
2022-12-03 19:52:19 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
describe("part 2", () => {
|
2022-12-03 20:26:15 +00:00
|
|
|
test("solution", () => {
|
|
|
|
expectSolution(solutionPart2(puzzleInput)).toEqual(2434);
|
2022-12-03 19:52:19 +00:00
|
|
|
});
|
|
|
|
});
|