test: add unit test for part one
This commit is contained in:
17
internal/2025/DayTen/code_test.go
Normal file
17
internal/2025/DayTen/code_test.go
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
package dayten
|
||||||
|
|
||||||
|
import "testing"
|
||||||
|
|
||||||
|
var testInput = []string{
|
||||||
|
"[.##.] (3) (1,3) (2) (2,3) (0,2) (0,1) {3,5,4,7}",
|
||||||
|
"[...#.] (0,2,3,4) (2,3) (0,4) (0,1,2) (1,2,3,4) {7,5,12,7,2}",
|
||||||
|
"[.###.#] (0,1,2,3,4) (0,3,4) (0,1,2,4,5) (1,2) {10,11,11,5,10,5}",
|
||||||
|
}
|
||||||
|
|
||||||
|
func TestPartOne(t *testing.T) {
|
||||||
|
expected := 7
|
||||||
|
got := PartOne(testInput)
|
||||||
|
if got != expected {
|
||||||
|
t.Errorf("PartOne() = %d, want %d", got, expected)
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user