Files
adventofcode/2024/gareth/day18/day18_test.go
2025-01-13 23:48:55 +00:00

66 lines
421 B
Go

package day18
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestPart1(t *testing.T) {
r := Part1(`5,4
4,2
4,5
3,0
2,1
6,3
2,4
1,5
0,6
3,3
2,6
5,1
1,2
5,5
2,5
6,5
1,4
0,4
6,4
1,1
6,1
1,0
0,5
1,6
2,0`)
assert.Equal(t, 22, r)
}
func TestPart2(t *testing.T) {
r := Part2(`5,4
4,2
4,5
3,0
2,1
6,3
2,4
1,5
0,6
3,3
2,6
5,1
1,2
5,5
2,5
6,5
1,4
0,4
6,4
1,1
6,1
1,0
0,5
1,6
2,0`)
assert.Equal(t, 0, r)
}