test: add unit test for part one
This commit is contained in:
29
2020/day06/main_test.go
Normal file
29
2020/day06/main_test.go
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
var input = []string{
|
||||||
|
"abc",
|
||||||
|
"",
|
||||||
|
"a",
|
||||||
|
"b",
|
||||||
|
"c",
|
||||||
|
"",
|
||||||
|
"ab",
|
||||||
|
"ac",
|
||||||
|
"",
|
||||||
|
"a",
|
||||||
|
"a",
|
||||||
|
"a",
|
||||||
|
"a",
|
||||||
|
"",
|
||||||
|
"b",
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPartOne(t *testing.T) {
|
||||||
|
expected := 11
|
||||||
|
got := PartOne(input)
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user