test: add unit test for part one

This commit is contained in:
2025-12-21 09:05:19 +01:00
parent dfe08db759
commit 60ee8c0307

View File

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