X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fconditionals.lisp;h=af71104a4ddc62d5b755bca3b94503f1d65a2f6d;hb=HEAD;hp=9a73dc5d636aef850535cebf23d7cffde70059c8;hpb=604ea926e93002c3270b5669c2db8655488b8769;p=jscl.git diff --git a/tests/conditionals.lisp b/tests/conditionals.lisp index 9a73dc5..af71104 100644 --- a/tests/conditionals.lisp +++ b/tests/conditionals.lisp @@ -8,6 +8,17 @@ ; COND (test (eql nil (cond))) +(test (= 1 (cond (1)))) +(test (= 1 + (let ((x 0)) + (cond ((incf x)))))) (test (= 2 (cond (1 2)))) (test (= 3 (cond (nil 1) (2 3)))) (test (eql nil (cond (nil 1) (nil 2)))) + +; CASE + +(test (= (case 1 (2 3) (otherwise 42)) 42)) +(test (= (case 1 (2 3) (t 42)) 42)) +(test (= (case 1 (2 3) (1 42)) 42)) +(test (null (case 1 (2 3))))