This commit is contained in:
2023-12-12 12:33:37 +00:00
parent c53e7db1ea
commit 84e8207917
4 changed files with 840 additions and 1 deletions

View File

@@ -0,0 +1,32 @@
package day08
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestPart1(t *testing.T) {
r := Part1(
`LLR
AAA = (BBB, BBB)
BBB = (AAA, ZZZ)
ZZZ = (ZZZ, ZZZ)`)
require.Equal(t, 6, r)
}
func TestPart2(t *testing.T) {
r := Part2(
`LR
11A = (11B, XXX)
11B = (XXX, 11Z)
11Z = (11B, XXX)
22A = (22B, XXX)
22B = (22C, 22C)
22C = (22Z, 22Z)
22Z = (22B, 22B)
XXX = (XXX, XXX)`)
require.Equal(t, 6, r)
}