1 be08f67c 2024-12-02 lh (defpackage #:aoc-test/day-2
2 e5bbdca6 2024-12-03 lh (:use #:cl #:lisp-unit2)
3 e5bbdca6 2024-12-03 lh (:import-from aoc/day-2))
4 be08f67c 2024-12-02 lh (in-package #:aoc-test/day-2)
6 be08f67c 2024-12-02 lh (define-test test-day-2
8 5ebe82fb 2024-12-02 lh ;;; Test resets
9 5ebe82fb 2024-12-02 lh ;; Report where the first item needs to be skipped
10 e5bbdca6 2024-12-03 lh (assert (aoc/day-2:report-safe-p (list 30 24 25 28 31 33 35) :allow-skip t))
11 5ebe82fb 2024-12-02 lh ;; Report where the second item needs to be skipped
12 e5bbdca6 2024-12-03 lh (assert (aoc/day-2:report-safe-p (list 24 21 25 28 31 33 35) :allow-skip t))
13 5ebe82fb 2024-12-02 lh ;; Report where reset target needs to be removed
14 e5bbdca6 2024-12-03 lh (assert (aoc/day-2:report-safe-p (list 25 22 19 21 20 17 14 13) :allow-skip t))
15 5ebe82fb 2024-12-02 lh ;;; Test task 1 & 2
16 be08f67c 2024-12-02 lh (multiple-value-bind (task-1 task-2)
17 be08f67c 2024-12-02 lh (aoc:run-day 2 "7 6 4 2 1
23 be08f67c 2024-12-02 lh (assert= 2 task-1)
24 be08f67c 2024-12-02 lh (assert= 4 task-2)))