test: add unit test for part one
This commit is contained in:
18
internal/2016/DayFour/code_test.go
Normal file
18
internal/2016/DayFour/code_test.go
Normal file
@@ -0,0 +1,18 @@
|
||||
package dayfour
|
||||
|
||||
import "testing"
|
||||
|
||||
var testInput = []string{
|
||||
"aaaaa-bbb-z-y-x-123[abxyz]",
|
||||
"a-b-c-d-e-f-g-h-987[abcde]",
|
||||
"not-a-real-room-404[oarel]",
|
||||
"totally-real-room-200[decoy]",
|
||||
}
|
||||
|
||||
func TestPartOne(t *testing.T) {
|
||||
expected := 1514
|
||||
got := PartOne(testInput)
|
||||
if got != expected {
|
||||
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user