summaryrefslogtreecommitdiff
path: root/aoc_2021/day-02/example.test.ts
blob: d1cb264b7acdcf8d2e4de47cb14ea29ac66b3aeb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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);
});