From: Strigoides Date: Fri, 26 Apr 2013 12:41:16 +0000 (+1200) Subject: Test for DO*, OR, AND & COND X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=604ea926e93002c3270b5669c2db8655488b8769;p=jscl.git Test for DO*, OR, AND & COND --- diff --git a/tests/conditionals.lisp b/tests/conditionals.lisp new file mode 100644 index 0000000..9a73dc5 --- /dev/null +++ b/tests/conditionals.lisp @@ -0,0 +1,13 @@ +; Tests for conditional forms +; Boolean operators +(test (eql (and nil 1) nil)) +(test (= (and 1 2) 2)) + +(test (= (or nil 1) 1)) +(test (= (or 1 2) 1)) + +; COND +(test (eql nil (cond))) +(test (= 2 (cond (1 2)))) +(test (= 3 (cond (nil 1) (2 3)))) +(test (eql nil (cond (nil 1) (nil 2)))) diff --git a/tests/iter-macros.lisp b/tests/iter-macros.lisp index d1e9ca3..a19fd16 100644 --- a/tests/iter-macros.lisp +++ b/tests/iter-macros.lisp @@ -17,3 +17,10 @@ (n 0 (1+ n))) ((= n 10) (= a 55)))) + +; DO* +(test (do* ((a 0 b) + (b 1 (+ a b)) + (n 0 (1+ n))) + ((= n 10) + (= a 512))))