aoc21/d1/p1_test.go

43 lines
379 B
Go
Raw Permalink Normal View History

2022-02-07 21:59:19 +02:00
package d1
import (
"testing"
"github.com/stretchr/testify/assert"
)
2022-02-21 22:28:30 +02:00
func TestP1(t *testing.T) {
2022-02-07 21:59:19 +02:00
input := `
199
200
208
210
200
207
240
269
260
263
`
2022-02-21 22:28:30 +02:00
actual := P1(input)
2022-02-07 21:59:19 +02:00
assert.EqualValues(t, 7, actual)
}
2022-02-08 20:32:54 +02:00
2022-02-21 22:28:30 +02:00
func TestP2(t *testing.T) {
2022-02-08 20:32:54 +02:00
input := `
199
200
208
210
200
207
240
269
260
263
`
2022-02-21 22:28:30 +02:00
assert.EqualValues(t, 5, P2(input))
2022-02-08 20:32:54 +02:00
}