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

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

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

File size: 2.5 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Contains: Tests of non-ANSI exceptions sutation from CLHS for the LOOP macro
4
5(in-package :ba-test)
6
7(compile-and-load "ba-aux.lsp")
8
9;;; LOOP tests
10
11(def-all-error-test loop.1 'listp #'(lambda (x) `(loop . ,x)))
12
13(def-all-error-test loop.named.1 'symbolp #'(lambda (x) `(loop named ,x return nil)))
14(def-all-error-test loop.named.2 'listp #'(lambda (x) `(loop named . ,x)))
15
16(def-error-test loop.with.1 (loop with))
17(def-all-error-test loop.with.2 #'(lambda (x) (or (symbolp x) (listp x)))
18  #'(lambda (x) `(loop with ,x)))
19(def-all-error-test loop.with.3 'listp #'(lambda (x) `(loop with . ,x)))
20(def-all-error-test loop.with.4 'listp #'(lambda (x) `(loop with x . ,x)))
21(def-all-error-test loop.with.5 'listp #'(lambda (x) `(loop with x = . ,x)))
22(def-all-error-test loop.with.6 'listp #'(lambda (x) `(loop with x t = . ,x)))
23
24(def-error-test loop.initially.1 (loop initially))
25(def-all-error-test loop.initially.2 'listp #'(lambda (x) `(loop initially . ,x)))
26(def-all-error-test loop.initially.3 'listp #'(lambda (x) `(loop initially (progn) . ,x)))
27
28(def-error-test loop.finally.1 (loop finally))
29(def-all-error-test loop.finally.2 'listp #'(lambda (x) `(loop finally . ,x)))
30(def-all-error-test loop.finally.3 'listp #'(lambda (x) `(loop finally (progn) . ,x)))
31
32;;; LOOP FOR clauses
33
34(def-error-test loop.for.1 (loop for))
35(def-all-error-test loop.for.2 'listp #'(lambda (x) `(loop for . ,x)))
36(def-all-error-test loop.for.3 'symbol-or-list-p #'(lambda (x) `(loop for ,x)))
37(def-all-error-test loop.for.4 'symbol-or-list-p #'(lambda (x) `(loop for ,x = nil)))
38(def-error-test loop.for.5 (loop for x from))
39(def-error-test loop.for.6 (loop for x upfrom))
40(def-error-test loop.for.7 (loop for x downfrom))
41(def-error-test loop.for.8 (loop for x upto))
42(def-error-test loop.for.9 (loop for x to))
43(def-error-test loop.for.10 (loop for x below))
44
45(def-all-error-test loop.for.11 (typef '(or symbol list class))
46  #'(lambda (x) `(loop for e ,x = nil return e)))
47
48(def-all-error-test loop.for.12 'listp #'(lambda (x) `(loop for x . ,x)))
49(def-all-error-test loop.for.13 'listp #'(lambda (x) `(loop for x from . ,x)))
50(def-all-error-test loop.for.14 'listp #'(lambda (x) `(loop for x downfrom . ,x)))
51(def-all-error-test loop.for.15 'listp #'(lambda (x) `(loop for x upfrom . ,x)))
52(def-all-error-test loop.for.16 'listp #'(lambda (x) `(loop for x upto . ,x)))
53(def-all-error-test loop.for.17 'listp #'(lambda (x) `(loop for x to . ,x)))
54(def-all-error-test loop.for.18 'listp #'(lambda (x) `(loop for x downto . ,x)))
55
56
Note: See TracBrowser for help on using the repository browser.