test: add unit test for part one
This commit is contained in:
17
internal/2015/DayNine/code_test.go
Normal file
17
internal/2015/DayNine/code_test.go
Normal file
@@ -0,0 +1,17 @@
|
||||
package daynine
|
||||
|
||||
import "testing"
|
||||
|
||||
var testInput = []string{
|
||||
"London to Dublin = 464",
|
||||
"London to Belfast = 518",
|
||||
"Dublin to Belfast = 141",
|
||||
}
|
||||
|
||||
func TestPartOne(t *testing.T) {
|
||||
expected := 605
|
||||
got := PartOne(testInput)
|
||||
if got != expected {
|
||||
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user