diff options
Diffstat (limited to 'aoc_2021/day-02/example.test.ts')
-rw-r--r-- | aoc_2021/day-02/example.test.ts | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/aoc_2021/day-02/example.test.ts b/aoc_2021/day-02/example.test.ts new file mode 100644 index 0000000..d1cb264 --- /dev/null +++ b/aoc_2021/day-02/example.test.ts @@ -0,0 +1,22 @@ +import { expect, test } from "bun:test"; +import { main as part1 } from "./part_1"; +import { main as part2 } from "./part_2"; + +const example = `forward 5 +down 5 +forward 8 +up 3 +down 8 +forward 2`.split("\n"); + +test("part1", async () => { + const answer = 150; + const res = await part1(example); + expect(res).toEqual(answer); +}); + +test("part2", async () => { + const answer = 900; + const res = await part2(example); + expect(res).toEqual(answer); +}); |