test: add unit test for PartOne
This commit is contained in:
30
internal/2025/DaySeven/code_test.go
Normal file
30
internal/2025/DaySeven/code_test.go
Normal 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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user