This commit is contained in:
Gareth
2024-12-22 19:02:26 +00:00
parent 436e4376a2
commit 622f81a352
4 changed files with 3675 additions and 4 deletions

View File

@@ -0,0 +1,65 @@
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)
}