test: add unit test for PartOne

This commit is contained in:
2025-12-07 09:30:18 +01:00
parent 780263e78b
commit 96ca1afb9b

View File

@@ -0,0 +1,30 @@
package dayseven
import "testing"
var testInput = []string{
".......S.......",
"...............",
".......^.......",
"...............",
"......^.^......",
"...............",
".....^.^.^.....",
"...............",
"....^.^...^....",
"...............",
"...^.^...^.^...",
"...............",
"..^...^.....^..",
"...............",
".^.^.^.^.^...^.",
"...............",
}
func TestPartOne(t *testing.T) {
expected := 21
got := PartOne(testInput)
if got != expected {
t.Errorf("PartOne() = %d, want %d", got, expected)
}
}