test: add unit test for part one

This commit is contained in:
2025-11-28 14:54:16 +01:00
parent c3abc90a24
commit 228d8b475b

View File

@@ -0,0 +1,23 @@
package dayeight
import "testing"
var testInput = []string{
"nop +0",
"acc +1",
"jmp +4",
"acc +3",
"jmp -3",
"acc -99",
"acc +1",
"jmp -4",
"acc +6",
}
func TestPartOne(t *testing.T) {
expected := 5
got := PartOne(testInput)
if got != expected {
t.Errorf("PartOne() = %d, want %d", got, expected)
}
}