2024-12-05 07:42:18 +01:00
|
|
|
(defpackage :aoc/2024/05/tests
|
|
|
|
(:use :cl :aoc :aoc/tests :aoc/2024/tests :parachute :aoc/2024/05))
|
|
|
|
|
|
|
|
(in-package :aoc/2024/05/tests)
|
|
|
|
|
|
|
|
(define-test suite-2024-05
|
|
|
|
;:parent suite-2024
|
|
|
|
)
|
|
|
|
|
|
|
|
(define-test test-middle-page
|
|
|
|
:parent suite-2024-05
|
2024-12-07 09:54:28 +01:00
|
|
|
(is = 61 (middle-page '(75 47 61 53 29)))
|
2024-12-05 07:42:18 +01:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
(define-test test-order-pages
|
2024-12-07 09:54:28 +01:00
|
|
|
:parent suite-2024-05
|
|
|
|
(let ((rules (first sample-data)))
|
|
|
|
(is equalp (sort-with-rules rules '(75 97 47 61 53)) '(97 75 47 61 53))
|
|
|
|
(is equalp (sort-with-rules rules '(61 13 29)) '(61 29 13))
|
|
|
|
(is equalp (sort-with-rules rules '(97 13 75 29 47)) '(97 75 47 29 13))))
|
2024-12-05 07:42:18 +01:00
|
|
|
|
|
|
|
|
|
|
|
(define-test+run test-part1
|
|
|
|
:parent suite-2024-05
|
|
|
|
(true (equalp "143" (part1 sample-data))))
|
|
|
|
|
|
|
|
(define-test+run test-part2
|
|
|
|
:parent suite-2024-05
|
2024-12-07 09:54:28 +01:00
|
|
|
(true (equalp nil (part2 sample-data))))
|
2024-12-05 07:42:18 +01:00
|
|
|
|
|
|
|
|