aboutsummaryrefslogtreecommitdiffstats
path: root/AoC2022
diff options
context:
space:
mode:
authorOscar Najera <hi@oscarnajera.com>2022-12-13 16:35:16 +0100
committerOscar Najera <hi@oscarnajera.com>2022-12-13 16:35:16 +0100
commit31d848750cbaa568d227595a93e24568ab9dca6a (patch)
tree5d62b5a2341bbce98ed850f8dddf8e9626293cc2 /AoC2022
parent8cc2675f22d1fe94f09ad847e41a99a2450c1856 (diff)
downloadscratch-31d848750cbaa568d227595a93e24568ab9dca6a.tar.gz
scratch-31d848750cbaa568d227595a93e24568ab9dca6a.tar.bz2
scratch-31d848750cbaa568d227595a93e24568ab9dca6a.zip
explicit tests
Diffstat (limited to 'AoC2022')
-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