projects
/
jscl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ad09113
)
Add a few basic tests for iteration constructs
author
Strigoides
<Strigoides@gmail.com>
Fri, 26 Apr 2013 12:17:56 +0000
(
00:17
+1200)
committer
Strigoides
<Strigoides@gmail.com>
Fri, 26 Apr 2013 12:17:56 +0000
(
00:17
+1200)
tests/iter-macros.lisp
[new file with mode: 0644]
patch
|
blob
diff --git a/tests/iter-macros.lisp
b/tests/iter-macros.lisp
new file mode 100644
(file)
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))))