source: trunk/source/tests/ansi-tests/beyond-ansi/errors-data-and-control-flow-1.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: 5.0 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Mon May 30 15:38:09 2005
4;;;; Contains: Tests of non-ANSI exceptional situations from CLHS section 5, part 1
5
6(in-package :ba-test)
7
8(compile-and-load "ba-aux.lsp")
9
10;;; APPLY
11
12(def-all-error-test apply.1 'function-designator-p '(apply x nil))
13(def-all-error-test apply.2 'function-designator-p '(apply x '(1 2 3)))
14(def-error-test apply.3 (apply 'cons . 1))
15(def-all-error-test apply.4 'listp '(apply 'cons '1 x))
16
17;;; DEFUN
18
19(def-error-test defun.1 (defun))
20(def-error-test defun.2 (defun #.(gensym)))
21(def-error-test defun.3 (defun . foo))
22(def-error-test defun.4 (defun #.(gensym) #.(gensym)))
23(def-error-test defun.5 (defun #.(gensym) () . foo))
24
25(def-error-test defun.6 (defun #.(gensym) () "foo" "bar" (declare)))
26(def-error-test defun.7 (defun #.(gensym) () nil (declare)))
27
28;;; FIXME  Add lambda list tests
29
30;;; FLET
31
32(def-error-test flet.1 (flet . foo))
33(def-error-test flet.2 (flet foo))
34(def-error-test flet.3 (flet (foo)))
35(def-error-test flet.4 (flet ((foo))))
36(def-error-test flet.5 (flet ((foo . bar))))
37(def-error-test flet.6 (flet () . foo))
38(def-error-test flet.7 (flet ((foo () . bar))))
39(def-error-test flet.8 (flet ((foo z))))
40(def-error-test flet.9 (flet ((foo ((x y))))))
41(def-all-error-test flet.10 'symbolp
42  #'(lambda (x) (subst x 'x '(flet ((foo (&rest x)))))))
43(def-all-error-test flet.11 (typef '(or symbol cons))
44  #'(lambda (x) (subst x 'x '(flet ((foo (&optional x)))))))
45(def-all-error-test flet.12 (typef '(or symbol cons))
46  #'(lambda (x) (subst x 'x '(flet ((foo (&key x)))))))
47
48(def-error-test flet.13 (flet ((foo (&optional (x . bar)) nil))))
49(def-error-test flet.14 (flet ((foo (&optional (x nil . bar)) nil))))
50(def-error-test flet.15 (flet ((foo (&optional (x nil x-p . bar)) nil))))
51(def-error-test flet.16 (flet ((foo (&optional (x nil x-p nil)) nil))))
52
53(def-error-test flet.17 (flet ((foo (&key (x . bar)) nil))))
54(def-error-test flet.18 (flet ((foo (&key (x nil . bar)) nil))))
55(def-error-test flet.19 (flet ((foo (&key (x nil x-p . bar)) nil))))
56(def-error-test flet.20 (flet ((foo (&key (x nil x-p nil)) nil))))
57
58(def-error-test flet.21 (flet ((foo (&key ((x . bar))) nil))))
59(def-error-test flet.22 (flet ((foo (&key ((x y . z))) nil))))
60(def-error-test flet.23 (flet ((foo (&key ((x y z))) nil))))
61
62(def-all-error-test flet.24 'symbolp
63  #'(lambda (x) `(flet ((foo (&key ((,x y))) nil)))))
64
65(def-all-error-test flet.25 'symbolp
66  #'(lambda (x) `(flet ((foo (&key ((y ,x))) nil)))))
67
68(def-error-test flet.26 (flet ((foo (&aux . bar)))))
69(def-error-test flet.27 (flet ((foo (&aux (x . bar))))))
70(def-error-test flet.28 (flet ((foo (&aux (x nil . bar))))))
71(def-error-test flet.29 (flet ((foo (&aux (x nil nil))))))
72
73(def-error-test flet.30 (flet ((foo () "x" "y" (declare))) (foo)))
74(def-error-test flet.31 (flet ((foo () :bad1) (foo () :bad2)) (foo)))
75
76;;; FIXME Add tests for disallowed lambda list keywords
77
78;;; LABELS
79
80(def-error-test labels.1 (labels . foo))
81(def-error-test labels.2 (labels foo))
82(def-error-test labels.3 (labels (foo)))
83(def-error-test labels.4 (labels ((foo))))
84(def-error-test labels.5 (labels ((foo . bar))))
85(def-error-test labels.6 (labels () . foo))
86(def-error-test labels.7 (labels ((foo () . bar))))
87(def-error-test labels.8 (labels ((foo z))))
88(def-error-test labels.9 (labels ((foo ((x y))))))
89(def-all-error-test labels.10 'symbolp
90  #'(lambda (x) (subst x 'x '(labels ((foo (&rest x)))))))
91(def-all-error-test labels.11 (typef '(or symbol cons))
92  #'(lambda (x) (subst x 'x '(labels ((foo (&optional x)))))))
93(def-all-error-test labels.12 (typef '(or symbol cons))
94  #'(lambda (x) (subst x 'x '(labels ((foo (&key x)))))))
95
96(def-error-test labels.13 (labels ((foo (&optional (x . bar)) nil))))
97(def-error-test labels.14 (labels ((foo (&optional (x nil . bar)) nil))))
98(def-error-test labels.15 (labels ((foo (&optional (x nil x-p . bar)) nil))))
99(def-error-test labels.16 (labels ((foo (&optional (x nil x-p nil)) nil))))
100
101(def-error-test labels.17 (labels ((foo (&key (x . bar)) nil))))
102(def-error-test labels.18 (labels ((foo (&key (x nil . bar)) nil))))
103(def-error-test labels.19 (labels ((foo (&key (x nil x-p . bar)) nil))))
104(def-error-test labels.20 (labels ((foo (&key (x nil x-p nil)) nil))))
105
106(def-error-test labels.21 (labels ((foo (&key ((x . bar))) nil))))
107(def-error-test labels.22 (labels ((foo (&key ((x y . z))) nil))))
108(def-error-test labels.23 (labels ((foo (&key ((x y z))) nil))))
109
110(def-all-error-test labels.24 'symbolp
111  #'(lambda (x) `(labels ((foo (&key ((,x y))) nil)))))
112
113(def-all-error-test labels.25 'symbolp
114  #'(lambda (x) `(labels ((foo (&key ((y ,x))) nil)))))
115
116(def-error-test labels.26 (labels ((foo (&aux . bar)))))
117(def-error-test labels.27 (labels ((foo (&aux (x . bar))))))
118(def-error-test labels.28 (labels ((foo (&aux (x nil . bar))))))
119(def-error-test labels.29 (labels ((foo (&aux (x nil nil))))))
120
121(def-error-test labels.30 (labels ((foo () "x" "y" (declare))) (foo)))
122(def-error-test labels.31 (labels ((foo () :bad1) (foo () :bad2)) (foo)))
123
124;;; FIXME Add tests for disallowed lambda list keywords
125
126;;; MACROLET
127;;; FIXME: add these
Note: See TracBrowser for help on using the repository browser.