test: add unit tests for p1/p2

This commit is contained in:
2025-12-01 20:09:29 +01:00
parent f98034b00c
commit f28611a7bf

View File

@@ -0,0 +1,25 @@
package daythree
import "testing"
var testInput = []string{
"#1 @ 1,3: 4x4",
"#2 @ 3,1: 4x4",
"#3 @ 5,5: 2x2",
}
func TestPartOne(t *testing.T) {
expected := 4
got := PartOne(testInput)
if got != expected {
t.Errorf("PartOne() = %d, want %d", got, expected)
}
}
func TestPartTwo(t *testing.T) {
expected := 3
got := PartTwo(testInput)
if got != expected {
t.Errorf("PartTwo() = %d, want %d", got, expected)
}
}