aoc-cl/tests/2024/day16-test.lisp

48 lines
985 B
Common Lisp
Raw Permalink Normal View History

2024-12-15 22:25:10 +01:00
(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
2024-12-16 09:22:43 +01:00
)
2024-12-15 22:25:10 +01:00
2024-12-16 09:22:43 +01:00
(defparameter test-maze2 (parse-input (aoc:split-lines "#################
#...#...#...#..E#
#.#.#.#.#.#.#.#.#
#.#.#.#...#...#.#
#.#.#.#.###.#.#.#
#...#.#.#.....#.#
#.#.#.#.#.#####.#
#.#...#.#.#.....#
#.#.#####.#.###.#
#.#.#.......#...#
#.#.###.#####.###
#.#.#...#.....#.#
#.#.#.#####.###.#
#.#.#.........#.#
#.#.#.#########.#
#S#.............#
#################")))
2024-12-15 22:25:10 +01:00
2024-12-16 09:22:43 +01:00
(define-test test-solve-maze2
:parent suite-2024-16
(is = 11048 (best-score test-maze2))
)
(define-test test-part2-maze2
:parent suite-2024-16
2024-12-22 07:08:37 +01:00
(is = 64 (solve-part2 test-maze2)))
2024-12-15 22:25:10 +01:00
(define-test+run test-part1
2024-12-16 09:22:43 +01:00
:parent suite-2024-16
(is equal "7036" (part1 sample-data)))
2024-12-15 22:25:10 +01:00
(define-test+run test-part2
2024-12-16 09:22:43 +01:00
:parent suite-2024-16
(is equal "45" (part2 sample-data)))