source: trunk/source/tests/ansi-tests/array-t.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: 4.5 KB
Line 
1;-*- Mode:     Lisp -*-
2;;;; Author:   Paul Dietz
3;;;; Created:  Sat Jan 25 11:55:48 2003
4;;;; Contains: Tests of (array t ...) type specifiers
5
6(in-package :cl-test)
7
8;;; Tests of (array t)
9
10(deftest array-t.2.1
11  (notnot-mv (typep #() '(array t)))
12  t)
13
14(deftest array-t.2.2
15  (notnot-mv (typep #0aX '(array t)))
16  t)
17
18(deftest array-t.2.3
19  (notnot-mv (typep #2a(()) '(array t)))
20  t)
21
22(deftest array-t.2.4
23  (notnot-mv (typep #(1 2 3) '(array t)))
24  t)
25
26(deftest array-t.2.5
27  (typep "abcd" '(array t))
28  nil)
29
30(deftest array-t.2.6
31  (typep #*010101 '(array t))
32  nil)
33
34;;; Tests of (array t ())
35
36(deftest array-t.3.1
37  (notnot-mv (typep #() '(array t nil)))
38  nil)
39
40(deftest array-t.3.2
41 (notnot-mv (typep #0aX '(array t nil)))
42  t)
43
44(deftest array-t.3.3
45  (typep #2a(()) '(array t nil))
46  nil)
47
48(deftest array-t.3.4
49  (typep #(1 2 3) '(array t nil))
50  nil)
51
52(deftest array-t.3.5
53  (typep "abcd" '(array t nil))
54  nil)
55
56(deftest array-t.3.6
57  (typep #*010101 '(array t nil))
58  nil)
59
60;;; Tests of (array t 1)
61;;; The '1' indicates rank, so this is equivalent to 'vector'
62
63(deftest array-t.4.1
64  (notnot-mv (typep #() '(array t 1)))
65  t)
66
67(deftest array-t.4.2
68  (typep #0aX '(array t 1))
69  nil)
70
71(deftest array-t.4.3
72  (typep #2a(()) '(array t 1))
73  nil)
74
75(deftest array-t.4.4
76  (notnot-mv (typep #(1 2 3) '(array t 1)))
77  t)
78
79(deftest array-t.4.5
80  (typep "abcd" '(array t 1))
81  nil)
82
83(deftest array-t.4.6
84  (typep #*010101 '(array t 1))
85  nil)
86
87;;; Tests of (array t 0)
88
89(deftest array-t.5.1
90  (typep #() '(array t 0))
91  nil)
92
93(deftest array-t.5.2
94  (notnot-mv (typep #0aX '(array t 0)))
95  t)
96
97(deftest array-t.5.3
98  (typep #2a(()) '(array t 0))
99  nil)
100
101(deftest array-t.5.4
102  (typep #(1 2 3) '(array t 0))
103  nil)
104
105(deftest array-t.5.5
106  (typep "abcd" '(array t 0))
107  nil)
108
109(deftest array-t.5.6
110  (typep #*010101 '(array t 0))
111  nil)
112
113;;; Tests of (array t *)
114
115(deftest array-t.6.1
116  (notnot-mv (typep #() '(array t *)))
117  t)
118
119(deftest array-t.6.2
120  (notnot-mv (typep #0aX '(array t *)))
121  t)
122
123(deftest array-t.6.3
124  (notnot-mv (typep #2a(()) '(array t *)))
125  t)
126
127(deftest array-t.6.4
128  (notnot-mv (typep #(1 2 3) '(array t *)))
129  t)
130
131(deftest array-t.6.5
132  (typep "abcd" '(array t *))
133  nil)
134
135(deftest array-t.6.6
136  (typep #*010101 '(array t *))
137  nil)
138
139;;; Tests of (array t 2)
140
141(deftest array-t.7.1
142  (typep #() '(array t 2))
143  nil)
144
145(deftest array-t.7.2
146  (typep #0aX '(array t 2))
147  nil)
148
149(deftest array-t.7.3
150  (notnot-mv (typep #2a(()) '(array t 2)))
151  t)
152
153(deftest array-t.7.4
154  (typep #(1 2 3) '(array t 2))
155  nil)
156
157(deftest array-t.7.5
158  (typep "abcd" '(array t 2))
159  nil)
160
161(deftest array-t.7.6
162  (typep #*010101 '(array t 2))
163  nil)
164
165;;; Testing '(array t (--))
166
167(deftest array-t.8.1
168  (typep #() '(array t (1)))
169  nil)
170         
171(deftest array-t.8.2
172  (notnot-mv (typep #() '(array t (0))))
173  t)
174
175(deftest array-t.8.3
176  (notnot-mv (typep #() '(array t (*))))
177  t)
178
179(deftest array-t.8.4
180  (typep #(a b c) '(array t (2)))
181  nil)
182         
183(deftest array-t.8.5
184  (notnot-mv (typep #(a b c) '(array t (3))))
185  t)
186
187(deftest array-t.8.6
188  (notnot-mv (typep #(a b c) '(array t (*))))
189  t)
190
191(deftest array-t.8.7
192  (typep #(a b c) '(array t (4)))
193  nil)
194
195(deftest array-t.8.8
196  (typep #2a((a b c)) '(array t (*)))
197  nil)
198
199(deftest array-t.8.9
200  (typep #2a((a b c)) '(array t (3)))
201  nil)
202
203(deftest array-t.8.10
204  (typep #2a((a b c)) '(array t (1)))
205  nil)
206
207(deftest array-t.8.11
208  (typep "abc" '(array t (2)))
209  nil)
210         
211(deftest array-t.8.12
212  (typep "abc" '(array t (3)))
213  nil)
214
215(deftest array-t.8.13
216  (typep "abc" '(array t (*)))
217  nil)
218
219(deftest array-t.8.14
220  (typep "abc" '(array t (4)))
221  nil)
222
223;;; Two dimensional array type tests
224
225(deftest array-t.9.1
226  (typep #() '(array t (* *)))
227  nil)
228
229(deftest array-t.9.2
230  (typep "abc" '(array t (* *)))
231  nil)
232
233(deftest array-t.9.3
234  (typep #(a b c) '(array t (3 *)))
235  nil)
236
237(deftest array-t.9.4
238  (typep #(a b c) '(array t (* 3)))
239  nil)
240
241(deftest array-t.9.5
242  (typep "abc" '(array t (3 *)))
243  nil)
244
245(deftest array-t.9.6
246  (typep "abc" '(array t (* 3)))
247  nil)
248
249(deftest array-t.9.7
250  (notnot-mv (typep #2a((a b)(c d)(e f)) '(array t (* *))))
251  t)
252
253(deftest array-t.9.8
254  (notnot-mv (typep #2a((a b)(c d)(e f)) '(array t (3 *))))
255  t)
256
257(deftest array-t.9.9
258  (typep #2a((a b)(c d)(e f)) '(array t (2 *)))
259  nil)
260
261(deftest array-t.9.10
262  (notnot-mv (typep #2a((a b)(c d)(e f)) '(array t (* 2))))
263  t)
264
265(deftest array-t.9.11
266  (typep #2a((a b)(c d)(e f)) '(array t (* 3)))
267  nil)
268
269(deftest array-t.9.12
270  (notnot-mv (typep #2a((a b)(c d)(e f)) '(array t (3 2))))
271  t)
272
273(deftest array-t.9.13
274  (typep #2a((a b)(c d)(e f)) '(array t (2 3)))
275  nil)
Note: See TracBrowser for help on using the repository browser.