source: trunk/source/tests/ansi-tests/beyond-ansi/errors-types-and-class.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: 3.7 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Mon May 30 07:49:10 2005
4;;;; Contains: Tests for non-ansi exceptional situations in Section 4 of CLHS
5
6(in-package :ba-test)
7
8(compile-and-load "ba-aux.lsp")
9
10;;; COERCE
11
12(def-all-error-test coerce.1 'listp '(coerce t x))
13
14;;; DEFTYPE
15
16(def-error-test deftype.1 (deftype))
17(def-error-test deftype.2 (deftype #.(gensym)))
18(def-error-test deftype.3 (deftype . foo))
19(def-all-error-test deftype.4 'symbolp '(deftype x () t))
20
21;;; SUBTYPEP
22
23(def-all-error-test subtypep.1 'type-specifier-p '(subtypep x t))
24(def-all-error-test subtypep.2 'type-specifier-p '(subtypep nil x))
25
26;;; TYPEP
27
28(def-all-error-test typep.1 'type-specifier-p '(typep nil x))
29
30;;; SATISFIES
31
32(def-error-test satisfies.1 (typep nil '(satifies)))
33(def-error-test satisfies.2 (typep nil '(satifies null nil)))
34(def-all-error-test satisfies.3 'symbolp '(typep nil (satisfies x)))
35
36;;; MEMBER (type specifier)
37
38(def-error-test member.type.1 (typep nil 'member))
39(def-error-test member.type.2 (typep nil '(member . foo)))
40(def-error-test member.type.3 (typep nil '(member bar . foo)))
41
42;;; NOT (type specifier)
43
44(def-error-test not.type.1 (typep nil 'not))
45(def-error-test not.type.2 (typep nil '(not)))
46(def-error-test not.type.3 (typep nil '(not *)))
47(def-error-test not.type.4 (typep nil '(not nil nil)))
48(def-all-error-test not.type.5 'type-specifier-p '(typep nil '(not x)))
49(def-error-test not.type.6 (typep nil '(not . foo)))
50
51;;; AND (type specifier)
52
53(def-error-test and.type.1 (typep nil 'and))
54(def-error-test and.type.2 (typep nil '(and *)))
55(def-error-test and.type.3 (typep nil '(and t * t)))
56(def-error-test and.type.4 (typep nil '(and . foo)))
57(def-all-error-test and.type.5 'type-specifier-p '(typep t '(and t t x t)))
58
59;;; OR (type specifier)
60
61(def-error-test or.type.1 (typep nil 'or))
62(def-error-test or.type.2 (typep nil '(or *)))
63(def-error-test or.type.3 (typep nil '(or nil * nil)))
64(def-error-test or.type.4 (typep nil '(or . foo)))
65(def-all-error-test or.type.5 'type-specifier-p '(typep t '(or nil x nil)))
66
67;;; VALUES (type specifier)
68
69(def-error-test values.type.1 (typep nil 'values))
70(def-error-test values.type.2 (the values (values)))
71(def-error-test values.type.3 (the (values . foo) (values)))
72(def-error-test values.type.4 (the (values *) t))
73(def-all-error-test values.type.5 'type-specifier-p '(the (values x) t))
74
75;;; EQL (type specifier)
76
77(def-error-test eql.type.1 (typep nil 'eql))
78(def-error-test eql.type.2 (typep nil '(eql)))
79(def-error-test eql.type.3 (typep nil '(eql nil nil)))
80(def-error-test eql.type.4 (typep nil '(eql . foo)))
81
82;;; TYPE-ERROR-DATUM
83
84(def-all-error-test type-error-datum.1
85  (typef 'type-error) '(type-error-datum x))
86
87;;; TYPE-ERROR-EXPECTED-TYPE
88
89(def-all-error-test type-error-expected-type.1
90  (typef 'type-error) '(type-error-expected-type x))
91
92;;; FUNCTION (type specifier)
93
94(def-error-test function.type.1
95  (locally (declare (type (function . foo) f)) nil))
96(def-error-test function.type.2
97  (locally (declare (type (function () . foo) f)) nil))
98(def-error-test function.type.3
99  (locally (declare (type (function (t . t) t) f)) nil))
100(def-error-test function.type.4
101  (locally (declare (type (function (&optional . foo) t) f)) nil))
102(def-error-test function.type.5
103  (locally (declare (type (function (&rest . foo) t) f)) nil))
104(def-error-test function.type.6
105  (locally (declare (type (function (&key . foo) t) f)) nil))
106(def-error-test function.type.7
107  (locally (declare (type (function (&key :foo) t) f)) nil))
108(def-error-test function.type.8
109  (locally (declare (type (function (&key (:foo . bar)) t) f)) nil))
110(def-error-test function.type.9
111  (locally (declare (type (function (&key (:foo t . bar)) t) f)) nil))
112(def-error-test function.type.10
113  (locally (declare (type (function (&key (:foo t nil)) t) f)) nil))
Note: See TracBrowser for help on using the repository browser.