Files
adventofcode/2024/go/day02/day02_test.go
2024-12-02 10:11:17 +00:00

30 lines
347 B
Go

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