2020 day2 - string parsing & simple validation

This commit is contained in:
alexchao26
2020-12-02 00:15:37 -05:00
parent f363235bc9
commit 79925f6507
7 changed files with 1253 additions and 5 deletions
+43
View File
@@ -0,0 +1,43 @@
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("got %v, want %v", got, test.want)
}
})
}
}
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("got %v, want %v", got, test.want)
}
})
}
}