2022-12-18 22:13:07 +00:00
|
|
|
import { test, expect, describe } from "vitest";
|
|
|
|
|
|
|
|
import { expectSolution } from "../01/main.js";
|
|
|
|
import part1, { sample, puzzleInput } from "./part1.js";
|
|
|
|
import part2 from "./part2.js";
|
|
|
|
|
|
|
|
describe("part 1", () => {
|
|
|
|
test( "input", ()=> {
|
|
|
|
expect(sample).toMatchObject({AA: {
|
|
|
|
exists: [
|
|
|
|
'DD', 'II', 'BB',
|
|
|
|
],
|
|
|
|
flow: 0,
|
|
|
|
}})
|
|
|
|
|
|
|
|
} )
|
2022-12-25 22:09:27 +00:00
|
|
|
test("sample", () => {
|
|
|
|
expect(part1(sample)).toEqual(1651);
|
2022-12-18 22:13:07 +00:00
|
|
|
});
|
2023-11-30 15:10:58 +00:00
|
|
|
test("solution", () => {
|
2022-12-25 22:09:27 +00:00
|
|
|
const r= part1(puzzleInput);
|
|
|
|
expect(r).toBeGreaterThan(707);
|
|
|
|
expectSolution(part1(puzzleInput)).toEqual(1871);
|
2022-12-18 22:13:07 +00:00
|
|
|
});
|
|
|
|
});
|
|
|
|
|
2022-12-25 22:09:27 +00:00
|
|
|
describe.only("part 2", () => {
|
2023-11-30 15:10:58 +00:00
|
|
|
test.skip("sample", () => {
|
2022-12-25 22:09:27 +00:00
|
|
|
expect(part2(sample)).toEqual(1707);
|
|
|
|
});
|
2023-11-30 15:10:58 +00:00
|
|
|
test("solution", () => {
|
2022-12-18 22:13:07 +00:00
|
|
|
expectSolution(part2(puzzleInput)).toEqual("TODO");
|
|
|
|
});
|
|
|
|
});
|