From b750c1445db20997237b1defb6583effb5f4d59d Mon Sep 17 00:00:00 2001 From: Strigoides Date: Sat, 27 Apr 2013 00:17:56 +1200 Subject: [PATCH] Add a few basic tests for iteration constructs --- tests/iter-macros.lisp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/iter-macros.lisp 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)))) -- 1.7.10.4