Files
adventofcode/2022/go/day04/day04_test.go
2023-11-16 10:48:53 +00:00

30 lines
321 B
Go

package day04
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestPart1(t *testing.T) {
r := Part1(
`2-4,6-8
2-3,4-5
5-7,7-9
2-8,3-7
6-6,4-6
2-6,4-8`)
require.Equal(t, 2, r)
}
func TestPart2(t *testing.T) {
r := Part2(
`2-4,6-8
2-3,4-5
5-7,7-9
2-8,3-7
6-6,4-6
2-6,4-8`)
require.Equal(t, 4, r)
}