Browse Source

add day 6 to main.go and tests

master
Alexander Avery 11 months ago
parent
commit
034689df5a
  1. 1
      main.go
  2. 25
      main_test.go

1
main.go

@ -25,6 +25,7 @@ var (
&day03{},
&day04{},
&day05{},
&day06{},
}
)

25
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)
}
}

Loading…
Cancel
Save