29 lines
892 B
TypeScript
29 lines
892 B
TypeScript
import path from "path";
|
|
|
|
import { readlines } from "../../_utils";
|
|
import { part1_solver, part2_solver } from "./solution";
|
|
|
|
describe("day 4: scratchcards, pt 1", () => {
|
|
test("sample input", async () => {
|
|
const sample = await readlines(path.resolve(__dirname, "./sample.txt"));
|
|
expect(part1_solver(sample)).toBe(13);
|
|
});
|
|
|
|
test("submission input", async () => {
|
|
const input = await readlines(path.resolve(__dirname, "./input.txt"));
|
|
expect(part1_solver(input)).toBe(32609);
|
|
});
|
|
});
|
|
|
|
describe("day 4: scratchcards, pt 2", () => {
|
|
test("sample input", async () => {
|
|
const sample = await readlines(path.resolve(__dirname, "./sample.txt"));
|
|
expect(part2_solver(sample)).toBe(30);
|
|
});
|
|
|
|
test("submission input", async () => {
|
|
const input = await readlines(path.resolve(__dirname, "./input.txt"));
|
|
expect(part2_solver(input)).toBe(14624680);
|
|
});
|
|
});
|