test: add unit test for part one
This commit is contained in:
1 parent
94b15548cf
commit
6f7561213e
1 file changed
+17
@@ -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