test: add unit test for part one

This commit is contained in:
2025-12-22 10:19:04 +01:00
parent c5ce7ae67a
commit 9cd6796996

View File

@@ -0,0 +1,17 @@
package daytwo
import "testing"
var testInput = [][]int{
{5, 1, 9, 5},
{7, 5, 3},
{2, 4, 6, 8},
}
func TestPartOne(t *testing.T) {
got := PartOne(testInput)
expected := 18
if got != expected {
t.Errorf("PartOne() = %d, want %d", got, expected)
}
}