Files
adventofcode/2023/go/day12/day12_test.go
2023-12-15 16:07:58 +00:00

30 lines
479 B
Go

package day12
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestPart1(t *testing.T) {
r := Part1(
`???.### 1,1,3
.??..??...?##. 1,1,3
?#?#?#?#?#?#?#? 1,3,1,6
????.#...#... 4,1,1
????.######..#####. 1,6,5
?###???????? 3,2,1`)
require.Equal(t, 21, r)
}
func TestPart2(t *testing.T) {
r := Part2(
`???.### 1,1,3
.??..??...?##. 1,1,3
?#?#?#?#?#?#?#? 1,3,1,6
????.#...#... 4,1,1
????.######..#####. 1,6,5
?###???????? 3,2,1`)
require.Equal(t, 525152, r)
}