test: add unit test for p1
This commit is contained in:
21
internal/2018/DayTwo/code_test.go
Normal file
21
internal/2018/DayTwo/code_test.go
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
package daytwo
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
var testInput = []string{
|
||||||
|
"abcdef",
|
||||||
|
"bababc",
|
||||||
|
"abbcde",
|
||||||
|
"abcccd",
|
||||||
|
"aabcdd",
|
||||||
|
"abcdee",
|
||||||
|
"ababab",
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPartOne(t *testing.T) {
|
||||||
|
expected := 12
|
||||||
|
got := PartOne(testInput)
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user