10 |
;;; of which x is a member. |
;;; of which x is a member. |
11 |
|
|
12 |
(deftest type-of.1 |
(deftest type-of.1 |
13 |
|
:notes :type-of/strict-builtins |
14 |
(loop for x in *universe* |
(loop for x in *universe* |
15 |
for tp = (type-of x) |
for tp = (type-of x) |
16 |
for failures = (loop for tp2 in *cl-all-type-symbols* |
for failures = (loop for tp2 in *cl-all-type-symbols* |
20 |
when failures collect (list x failures)) |
when failures collect (list x failures)) |
21 |
nil) |
nil) |
22 |
|
|
23 |
|
;;; Some have objected to that (in type-of.1) interpretation |
24 |
|
;;; of req. 1.a in the TYPE-OF page, saying that it need hold |
25 |
|
;;; for only *one* builtin type that the object is an element of. |
26 |
|
;;; This test tests the relaxed requirement. |
27 |
|
|
28 |
|
(deftest type-of.1-relaxed |
29 |
|
(loop for x in *universe* |
30 |
|
for builtins = (remove x *cl-all-type-symbols* |
31 |
|
:test (complement #'typep)) |
32 |
|
for tp = (type-of x) |
33 |
|
when (and builtins |
34 |
|
(not (loop for tp2 in builtins |
35 |
|
thereis (subtypep tp tp2)))) |
36 |
|
collect x) |
37 |
|
nil) |
38 |
|
|
39 |
;;; 1. For any object that is an element of some built-in type: |
;;; 1. For any object that is an element of some built-in type: |
40 |
;;; b. the type returned does not involve and, eql, member, not, |
;;; b. the type returned does not involve and, eql, member, not, |
41 |
;;; or, satisfies, or values. |
;;; or, satisfies, or values. |
98 |
(eqt (type-of (make-instance class)) class)) |
(eqt (type-of (make-instance class)) class)) |
99 |
t) |
t) |
100 |
|
|
|
|
|
101 |
;;; Error tests |
;;; Error tests |
102 |
|
|
103 |
(deftest type-of.error.1 |
(deftest type-of.error.1 |