19 |
when failures collect (list x failures)) |
when failures collect (list x failures)) |
20 |
nil) |
nil) |
21 |
|
|
22 |
|
;;; 1. For any object that is an element of some built-in type: |
23 |
|
;;; b. the type returned does not involve and, eql, member, not, |
24 |
|
;;; or, satisfies, or values. |
25 |
|
;;; |
26 |
|
;;; Since every object is an element of the built-in type T, this |
27 |
|
;;; applies universally. |
28 |
|
|
29 |
|
(deftest type-of.2 |
30 |
|
(loop for x in *universe* |
31 |
|
for tp = (type-of x) |
32 |
|
when (and (consp tp) |
33 |
|
(member (car tp) '(and eql member not or satisfies values |
34 |
|
function))) |
35 |
|
collect x) |
36 |
|
nil) |
37 |
|
|
38 |
|
(deftest type-of.3 |
39 |
|
(loop for x in *universe* |
40 |
|
unless (typep x (type-of x)) |
41 |
|
collect x) |
42 |
|
nil) |
43 |
|
|
44 |
|
(deftest type-of.4 |
45 |
|
(loop for x in *universe* |
46 |
|
for tp = (type-of x) |
47 |
|
for class = (class-of x) |
48 |
|
unless (equal (multiple-value-list (subtypep* tp class)) '(t t)) |
49 |
|
collect x) |
50 |
|
nil) |
51 |
|
|
52 |
|
(deftest type-of.5 |
53 |
|
(loop for x in *cl-condition-type-symbols* |
54 |
|
for cnd = (make-condition x) |
55 |
|
for tp = (type-of cnd) |
56 |
|
unless (eq x tp) |
57 |
|
collect x) |
58 |
|
nil) |
59 |
|
|
60 |
|
;;; Error tests |
61 |
|
|
62 |
|
(deftest type-of.error.1 |
63 |
|
(classify-error (type-of)) |
64 |
|
program-error) |
65 |
|
|
66 |
|
(deftest type-of.error.2 |
67 |
|
(classify-error (type-of nil nil)) |
68 |
|
program-error) |