This commit is contained in:
2024-12-04 09:03:27 +00:00
committed by Gareth
parent e2ab6dce9a
commit b1a4969f6d
5 changed files with 253 additions and 3 deletions

View File

@@ -0,0 +1,35 @@
package day04
import (
"testing"
"github.com/stretchr/testify/require"
)
func TestPart1(t *testing.T) {
r := Part1(`MMMSXXMASM
MSAMXMSMSA
AMXSXMAAMM
MSAMASMSMX
XMASAMXAMM
XXAMMXXAMA
SMSMSASXSS
SAXAMASAAA
MAMMMXMMMM
MXMXAXMASX`)
require.Equal(t, 18, r)
}
func TestPart2(t *testing.T) {
r := Part2(`MMMSXXMASM
MSAMXMSMSA
AMXSXMAAMM
MSAMASMSMX
XMASAMXAMM
XXAMMXXAMA
SMSMSASXSS
SAXAMASAAA
MAMMMXMMMM
MXMXAXMASX`)
require.Equal(t, 9, r)
}