aboutsummaryrefslogtreecommitdiffstats
path: root/AoC2022/13
diff options
context:
space:
mode:
Diffstat (limited to 'AoC2022/13')
-rw-r--r--AoC2022/13/solver.el19
1 files changed, 9 insertions, 10 deletions
diff --git a/AoC2022/13/solver.el b/AoC2022/13/solver.el
index b3b636b..3039c1e 100644
--- a/AoC2022/13/solver.el
+++ b/AoC2022/13/solver.el
@@ -42,16 +42,15 @@
result)))))
(ert-deftest test-comparison ()
- (pcase-dolist (`(,f ,s ,r)
- '((5 5 next)
- (5 nil nil)
- (nil 5 t)
- (nil nil next)
- ('(9) '((8 7)) nil)
- ('(1 1 3 1 1) '(1 1 5 1 1) t)
- ('((1) (2 3 4)) '((1) 4) t)
- ('() '(5) t)))
- (should (eq (solver-compare f s) r))))
+ (should (eq (solver-compare 5 5) 'next))
+ (should (eq (solver-compare nil nil) 'next))
+ (should-not (solver-compare 5 nil))
+ (should (solver-compare nil 5))
+ (should (eq (solver-compare '(9) '((8 7))) nil))
+ (should (solver-compare '(1 1 3 1 1) '(1 1 5 1 1)))
+ (should (solver-compare '((1) (2 3 4)) '((1) 4)))
+ (should (solver-compare '() '(5))))
+
(defun solver-p1 (filename)
(cl-loop