From: Strigoides Date: Fri, 26 Apr 2013 12:17:56 +0000 (+1200) Subject: Add a few basic tests for iteration constructs X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=b750c1445db20997237b1defb6583effb5f4d59d;p=jscl.git Add a few basic tests for iteration constructs --- diff --git a/tests/iter-macros.lisp b/tests/iter-macros.lisp new file mode 100644 index 0000000..d1e9ca3 --- /dev/null +++ b/tests/iter-macros.lisp @@ -0,0 +1,19 @@ +; Tests for macros implementing iteration constructs +; DOTIMES +(test (let ((total 0)) + (dotimes (n 6) + (incf total n)) + (= total 15))) + +; DOLIST +(test (let ((total 0)) + (dolist (n '(1 2 3 4 5)) + (incf total n)) + (= total 15))) + +; DO +(test (do ((a 0 b) + (b 1 (+ a b)) + (n 0 (1+ n))) + ((= n 10) + (= a 55))))