advent-of-code/2021/deno/3.test.ts

24 lines
434 B
TypeScript
Raw Permalink Normal View History

2021-12-03 09:36:46 -06:00
import { assertEquals } from "https://deno.land/std@0.116.0/testing/asserts.ts";
import { part1, part2 } from "./3.ts";
const testInput = `00100
11110
10110
10111
10101
01111
00111
11100
10000
11001
00010
01010`.trim().split("\n").map((s) => s.trim());
Deno.test("day 3 part 1", async () => {
assertEquals(await part1(testInput), 198);
});
Deno.test("day 3 part 2", async () => {
assertEquals(await part2(testInput), 230);
});