Day02
This commit is contained in:
27
2024/gareth/day02/day02_test.go
Normal file
27
2024/gareth/day02/day02_test.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user