This commit is contained in:
Gareth
2025-01-14 15:21:34 +00:00
parent 3e69c5b463
commit 225d74acf9
4 changed files with 381 additions and 6 deletions

View File

@@ -0,0 +1,45 @@
package day20
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestPart1(t *testing.T) {
r := Part1(`###############
#...#...#.....#
#.#.#.#.#.###.#
#S#...#.#.#...#
#######.#.#.###
#######.#.#...#
#######.#.###.#
###..E#...#...#
###.#######.###
#...###...#...#
#.#####.#.###.#
#.#...#.#.#...#
#.#.#.#.#.#.###
#...#...#...###
###############`)
assert.Equal(t, 44, r)
}
func TestPart2(t *testing.T) {
r := Part2(`###############
#...#...#.....#
#.#.#.#.#.###.#
#S#...#.#.#...#
#######.#.#.###
#######.#.#...#
#######.#.###.#
###..E#...#...#
###.#######.###
#...###...#...#
#.#####.#.###.#
#.#...#.#.#...#
#.#.#.#.#.#.###
#...#...#...###
###############`)
assert.Equal(t, 285, r)
}