package main import ( "strings" "testing" ) func TestDay01(t *testing.T) { input := `3 4 4 3 2 5 1 3 3 9 3 3` p1, p2 := strings.NewReader(input), strings.NewReader(input) if got, expected := part1(p1), "11"; got != expected { t.Errorf("day01 part 1 = %s; expected %s", got, expected) } if got, expected := part2(p2), "31"; got != expected { t.Errorf("day01 part 2 = %s; expected %s", got, expected) } }