bldc/tests/test_match_guard_0.lisp

12 lines
173 B
Common Lisp

(defun f (x)
(match x
( _ (<= x 10) (+ x 1))
( _ (> x 10) (+ x 100))))
(check (and (= (f 0) 1)
(= (f 2) 3)
(= (f 11) 111)))