aoc21/d3/d3_test.go

44 lines
385 B
Go
Raw Normal View History

2022-02-08 21:38:01 +02:00
package d3
import (
"testing"
"github.com/stretchr/testify/assert"
)
2022-02-21 22:28:30 +02:00
func TestP1(t *testing.T) {
2022-02-08 21:38:01 +02:00
input := `
00100
11110
10110
10111
10101
01111
00111
11100
10000
11001
00010
01010`
2022-02-21 22:28:30 +02:00
assert.EqualValues(t, 198, P1(input))
2022-02-08 21:38:01 +02:00
}
2022-02-09 21:03:38 +02:00
2022-02-21 22:28:30 +02:00
func TestP2(t *testing.T) {
2022-02-09 21:03:38 +02:00
input := `
00100
11110
10110
10111
10101
01111
00111
11100
10000
11001
00010
01010`
2022-02-21 22:28:30 +02:00
assert.EqualValues(t, 230, P2(input))
2022-02-09 21:03:38 +02:00
}