diff --git a/main.go b/main.go index b589891..a9b00f1 100644 --- a/main.go +++ b/main.go @@ -25,6 +25,7 @@ var ( &day03{}, &day04{}, &day05{}, + &day06{}, } ) diff --git a/main_test.go b/main_test.go index f488e5f..7bb1cf6 100644 --- a/main_test.go +++ b/main_test.go @@ -148,4 +148,29 @@ humidity-to-location map: t.Errorf("solve1() = %s; wanted %s", res, ans) } + ans = "46" + res = puzzle.solve2(strings.NewReader(input)) + if ans != res { + t.Errorf("solve2() = %s; wanted %s", res, ans) + } + +} + +func TestDay06(t *testing.T) { + input := `Time: 7 15 30 +Distance: 9 40 200` + + puzzle := day06{} + + ans := "288" + res := puzzle.solve1(strings.NewReader(input)) + if ans != res { + t.Errorf("solve1() = %s; wanted %s", res, ans) + } + + ans = "71503" + res = puzzle.solve2(strings.NewReader(input)) + if ans != res { + t.Errorf("solve2() = %s; wanted %s", res, ans) + } }