d1e9ca377e1987a1fbbe8df0522d65118492a05b
[jscl.git] / tests / iter-macros.lisp
1 ; Tests for macros implementing iteration constructs
2 ; DOTIMES
3 (test (let ((total 0))
4         (dotimes (n 6)
5           (incf total n))
6         (= total 15)))
7
8 ; DOLIST
9 (test (let ((total 0))
10         (dolist (n '(1 2 3 4 5))
11           (incf total n))
12         (= total 15)))
13
14 ; DO
15 (test (do ((a 0 b)                                 
16            (b 1 (+ a b))                                                          
17            (n 0 (1+ n)))                                                          
18         ((= n 10) 
19          (= a 55))))