Skip to content

Commit b477172

Browse files
committed
style: format
1 parent 5cb1c46 commit b477172

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

day08_test.ts

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -23,20 +23,21 @@ const example2 = [
2323
Deno.test("Day 8: Haunted Wasteland", async (t) => {
2424
await t.step("Part 1", async (t) => {
2525
await t.step("Example", async (t) => {
26-
await t.step("it should solve the first example", () =>
27-
assertEquals(navigate(example1), 2)
26+
await t.step(
27+
"it should solve the first example",
28+
() => assertEquals(navigate(example1), 2),
2829
);
29-
await t.step("it should solve the second example", () =>
30-
assertEquals(navigate(example2), 6)
30+
await t.step(
31+
"it should solve the second example",
32+
() => assertEquals(navigate(example2), 6),
3133
);
3234
});
3335

3436
await t.step("it should solve", async () =>
3537
assertEquals(
3638
navigate((await Deno.readTextFile("./input/day08.txt")).split("\n")),
37-
12599
38-
)
39-
);
39+
12599,
40+
));
4041
});
4142

4243
await t.step("Part 2", async (t) => {
@@ -55,19 +56,17 @@ Deno.test("Day 8: Haunted Wasteland", async (t) => {
5556
`22Z = (22B, 22B)`,
5657
`XXX = (XXX, XXX)`,
5758
]),
58-
6
59-
)
60-
);
59+
6,
60+
));
6161
});
6262

6363
await t.step("it should solve", async () =>
6464
assertEquals(
6565
ghostNavigate(
66-
(await Deno.readTextFile("./input/day08.txt")).split("\n")
66+
(await Deno.readTextFile("./input/day08.txt")).split("\n"),
6767
),
68-
8245452805243
69-
)
70-
);
68+
8245452805243,
69+
));
7170
});
7271
});
7372

@@ -102,13 +101,13 @@ const navigate = (map: string[]): number => {
102101
};
103102

104103
const parseMap = (
105-
map: string[]
104+
map: string[],
106105
): [string, Record<string, [string, string]>] => [
107106
map[0],
108107
map.slice(2).reduce((network, node) => {
109108
const { nodeId, left, right } =
110109
/^(?<nodeId>\w+) = \((?<left>\w+), (?<right>\w+)\)$/.exec(node)?.groups ??
111-
{};
110+
{};
112111
return {
113112
...network,
114113
[nodeId]: [left, right],

0 commit comments

Comments
 (0)