Files
advent-of-code-go/2020/day09/main_test.go
T
alexchao26 884f43e9bf cleanup tests
updated 2020 templates for easier addition of tests
2020-11-29 20:21:15 -05:00

44 lines
791 B
Go

package main
import "testing"
var tests1 = []struct {
name string
want int
input string
// add extra args if needed
}{
// {"actual", /* ACTUAL ANSWER */, util.ReadFile("input.txt")},
}
func TestPart1(t *testing.T) {
for _, test := range tests1 {
t.Run(test.name, func(*testing.T) {
got := part1(test.input)
if got != test.want {
t.Errorf("want %v, got %v", test.want, got)
}
})
}
}
var tests2 = []struct {
name string
want int
input string
// add extra args if needed
}{
// {"actual", /* ACTUAL ANSWER */, util.ReadFile("input.txt")},
}
func TestPart2(t *testing.T) {
for _, test := range tests2 {
t.Run(test.name, func(*testing.T) {
got := part2(test.input)
if got != test.want {
t.Errorf("want %v, got %v", test.want, got)
}
})
}
}