source: trunk/source/tests/ansi-tests/beyond-ansi/errors-iteration.lsp @ 8991

Last change on this file since 8991 was 8991, checked in by gz, 12 years ago

Check in the gcl ansi test suite (original, in preparation for making local changes)

File size: 3.0 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Contains: Tests of non-ANSI exceptions sutation from CLHS section 6 (Iteration)
4
5(in-package :ba-test)
6
7(compile-and-load "ba-aux.lsp")
8
9;;; DO tests
10
11(def-all-error-test do.1 'listp #'(lambda (x) `(do . ,x)))
12(def-all-error-test do.2 'listp #'(lambda (x) `(do () . ,x)))
13(def-all-error-test do.3 #'(lambda (x) (or (symbolp x) (listp x))) #'(lambda (x) `(do (,x))))
14(def-all-error-test do.4 'listp #'(lambda (x) `(do ((a 1 (1+ a)) . ,x))))
15(def-all-error-test do.5 'listp #'(lambda (x) `(do () ,x)))
16(def-all-error-test do.6 'listp #'(lambda (x) `(do () (t . ,x))))
17(def-all-error-test do.7 'listp #'(lambda (x) `(do () (t) . ,x)))
18(def-all-error-test do.8 'listp #'(lambda (x) `(do ((a . ,x)) (t))))
19(def-all-error-test do.9 'listp #'(lambda (x) `(do ((a 1 . ,x)) (t))))
20(def-all-error-test do.10 'listp #'(lambda (x) `(do ((a 1 (1+ a) . ,x)) (t))))
21(def-error-test do.11 (do))
22
23;;; DO* tests
24
25(def-all-error-test do*.1 'listp #'(lambda (x) `(do* . ,x)))
26(def-all-error-test do*.2 'listp #'(lambda (x) `(do* () . ,x)))
27(def-all-error-test do*.3 #'(lambda (x) (or (symbolp x) (listp x))) #'(lambda (x) `(do* (,x))))
28(def-all-error-test do*.4 'listp #'(lambda (x) `(do* ((a 1 (1+ a)) . ,x))))
29(def-all-error-test do*.5 'listp #'(lambda (x) `(do* () ,x)))
30(def-all-error-test do*.6 'listp #'(lambda (x) `(do* () (t . ,x))))
31(def-all-error-test do*.7 'listp #'(lambda (x) `(do* () (t) . ,x)))
32(def-all-error-test do*.8 'listp #'(lambda (x) `(do* ((a . ,x)) (t))))
33(def-all-error-test do*.9 'listp #'(lambda (x) `(do* ((a 1 . ,x)) (t))))
34(def-all-error-test do*.10 'listp #'(lambda (x) `(do* ((a 1 (1+ a) . ,x)) (t))))
35(def-error-test do*.11 (do*))
36
37;;; DOTIMES tests
38
39(def-error-test dotimes.1 (dotimes))
40(def-all-error-test dotimes.2 'listp #'(lambda (x) `(dotimes . ,x)))
41(def-all-error-test dotimes.3 'symbolp #'(lambda (x) `(dotimes (,x 1))))
42(def-all-error-test dotimes.4 (constantly nil) #'(lambda (x) `(dotimes (,x))))
43(def-all-error-test dotimes.5 'integerp #'(lambda (x) `(dotimes (i ',x))))
44(def-all-error-test dotimes.6 'listp #'(lambda (x) `(dotimes (i . ,x))))
45(def-all-error-test dotimes.7 'listp #'(lambda (x) `(dotimes (i 1 . ,x))))
46(def-all-error-test dotimes.8 'listp #'(lambda (x) `(dotimes (i 1) . ,x)))
47(def-all-error-test dotimes.9 'listp #'(lambda (x) `(dotimes (i 1 nil . ,x))))
48(def-all-error-test dotimes.10 'listp #'(lambda (x) `(dotimes (i 1 nil ,x))))
49
50;;; DOLIST tests
51
52(def-error-test dolist.1 (dolist))
53(def-all-error-test dolist.2 'listp #'(lambda (x) `(dolist . ,x)))
54(def-all-error-test dolist.3 'symbolp #'(lambda (x) `(dolist (,x nil))))
55(def-all-error-test dolist.4 'listp #'(lambda (x) `(dolist (e . ,x))))
56(def-all-error-test dolist.5 'listp #'(lambda (x) `(dolist (e nil . ,x))))
57(def-all-error-test dolist.6 'listp #'(lambda (x) `(dolist (e nil nil . ,x))))
58(def-all-error-test dolist.7 'listp #'(lambda (x) `(dolist (e nil nil ,x))))
59(def-all-error-test dolist.8 'listp #'(lambda (x) `(dolist (e ',x nil))))
60(def-all-error-test dolist.9 'listp #'(lambda (x) `(dolist (e nil nil) . ,x)))
Note: See TracBrowser for help on using the repository browser.