aoc-cl/tests/2024/day16-test.lisp
2024-12-22 07:08:37 +01:00

47 lines
985 B
Common Lisp

(defpackage :aoc/2024/16/tests
(:use :cl :aoc :aoc/tests :aoc/2024/tests :parachute :aoc/2024/16))
(in-package :aoc/2024/16/tests)
(define-test suite-2024-16
;:parent suite-2024
)
(defparameter test-maze2 (parse-input (aoc:split-lines "#################
#...#...#...#..E#
#.#.#.#.#.#.#.#.#
#.#.#.#...#...#.#
#.#.#.#.###.#.#.#
#...#.#.#.....#.#
#.#.#.#.#.#####.#
#.#...#.#.#.....#
#.#.#####.#.###.#
#.#.#.......#...#
#.#.###.#####.###
#.#.#...#.....#.#
#.#.#.#####.###.#
#.#.#.........#.#
#.#.#.#########.#
#S#.............#
#################")))
(define-test test-solve-maze2
:parent suite-2024-16
(is = 11048 (best-score test-maze2))
)
(define-test test-part2-maze2
:parent suite-2024-16
(is = 64 (solve-part2 test-maze2)))
(define-test+run test-part1
:parent suite-2024-16
(is equal "7036" (part1 sample-data)))
(define-test+run test-part2
:parent suite-2024-16
(is equal "45" (part2 sample-data)))