test: add unit test for part one

This commit is contained in:
2025-12-08 06:08:56 +01:00
parent b0cd4f37b1
commit a0805111b4

View File

@@ -0,0 +1,34 @@
package dayeight
import "testing"
var testInput = []string{
"162,817,812",
"57,618,57",
"906,360,560",
"592,479,940",
"352,342,300",
"466,668,158",
"542,29,236",
"431,825,988",
"739,650,466",
"52,470,668",
"216,146,977",
"819,987,18",
"117,168,530",
"805,96,715",
"346,949,466",
"970,615,88",
"941,993,340",
"862,61,35",
"984,92,344",
"425,690,689",
}
func TestPartOne(t *testing.T) {
expected := 40
got := PartOne(testInput)
if got != expected {
t.Errorf("PartOne() = %d, want %d", got, expected)
}
}