29 lines
929 B
TypeScript
29 lines
929 B
TypeScript
import path from "path";
|
|
import { readlines } from "../../_utils";
|
|
|
|
const solution = require("./solution");
|
|
|
|
describe("day 3: rucksack reorganization, pt 1", () => {
|
|
test("sample input", async () => {
|
|
const sample = await readlines(path.resolve(__dirname, "./sample.txt"));
|
|
expect(solution.part1_solver(sample)).toBe(157);
|
|
});
|
|
|
|
test("submission input", async () => {
|
|
const input = await readlines(path.resolve(__dirname, "./input.txt"));
|
|
expect(solution.part1_solver(input)).toBe(8109);
|
|
});
|
|
});
|
|
|
|
describe("day 3: rucksack reorganization, pt 2", () => {
|
|
test("sample input", async () => {
|
|
const sample = await readlines(path.resolve(__dirname, "./sample.txt"));
|
|
expect(solution.part2_solver(sample)).toBe(70);
|
|
});
|
|
|
|
test("submission input", async () => {
|
|
const input = await readlines(path.resolve(__dirname, "./input.txt"));
|
|
expect(solution.part2_solver(input)).toBe(2738);
|
|
});
|
|
});
|