From 604ea926e93002c3270b5669c2db8655488b8769 Mon Sep 17 00:00:00 2001 From: Strigoides Date: Sat, 27 Apr 2013 00:41:16 +1200 Subject: [PATCH] Test for DO*, OR, AND & COND --- tests/conditionals.lisp | 13 +++++++++++++ tests/iter-macros.lisp | 7 +++++++ 2 files changed, 20 insertions(+) create mode 100644 tests/conditionals.lisp 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)))) -- 1.7.10.4