test: add unit test for part one
This commit is contained in:
24
internal/2025/DayFour/code_test.go
Normal file
24
internal/2025/DayFour/code_test.go
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
package dayfour
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
var testInput = []string{
|
||||||
|
"..@@.@@@@.",
|
||||||
|
"@@@.@.@.@@",
|
||||||
|
"@@@@@.@.@@",
|
||||||
|
"@.@@@@..@.",
|
||||||
|
"@@.@@@@.@@",
|
||||||
|
".@@@@@@@.@",
|
||||||
|
".@.@.@.@@@",
|
||||||
|
"@.@@@.@@@@",
|
||||||
|
".@@@@@@@@.",
|
||||||
|
"@.@.@@@.@.",
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPartOne(t *testing.T) {
|
||||||
|
expected := 13
|
||||||
|
got := PartOne(testInput)
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user