(defpackage :aoc/2024/22/tests (:use :cl :aoc :aoc/tests :aoc/2024/tests :parachute :aoc/2024/22)) (in-package :aoc/2024/22/tests) (define-test suite-2024-22 ;:parent suite-2024 ) (define-test test-next-random :parent suite-2024-22 (let ((rnd 123)) (loop for expected in '(15887950 16495136 527345 704524 1553684 12683156 11100544 12249484 7753432 5908254) do (setf rnd (next-random rnd)) do (is = expected rnd)))) (define-test test-buyers-end-of-day :parent suite-2024-22 (loop for buyer in '((1 . 8685429) (10 . 4700978) (100 . 15273692) (2024 . 8667524)) do (is = (cdr buyer) (repeat-random (car buyer) 2000)))) (define-test+run test-part1 :parent suite-2024-22 (is equal 37327623 (part1 sample-data))) (define-test+run test-part2 :parent suite-2024-22 (is equal 23 (part2 sample-data2)))