This commit is contained in:
Gareth
2024-12-02 13:40:07 +00:00
parent c133fe757c
commit 8f5cb6b236
5 changed files with 1152 additions and 4 deletions

View File

@@ -0,0 +1,27 @@
package day02
import (
"testing"
"github.com/stretchr/testify/assert"
)
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`)
assert.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`)
assert.Equal(t, 4, r)
}