-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathday12_test.go
46 lines (43 loc) · 1.03 KB
/
day12_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// Package main provides ...
package main
import "testing"
func TestPartOne(t *testing.T) {
t.Run("Correct P1 Example", func(t *testing.T) {
rules := Parse("../input_small.txt")
groupings := BuildGroupings(rules)
got := Part1(groupings)
want := 6
if got != want {
t.Errorf("got %q want %q", got, want)
}
})
t.Run("Correct P1 Answer", func(t *testing.T) {
rules := Parse("../input.txt")
groupings := BuildGroupings(rules)
got := Part1(groupings)
want := 239
if got != want {
t.Errorf("got %q want %q", got, want)
}
})
}
func TestPartTwo(t *testing.T) {
t.Run("Correct P2 Example", func(t *testing.T) {
rules := Parse("../input_small.txt")
groupings := BuildGroupings(rules)
got := Part2(groupings)
want := 2
if got != want {
t.Errorf("got %q want %q", got, want)
}
})
t.Run("Correct P2 Answer", func(t *testing.T) {
rules := Parse("../input.txt")
groupings := BuildGroupings(rules)
got := Part2(groupings)
want := 215
if got != want {
t.Errorf("got %q want %q", got, want)
}
})
}