Commit d56a34a0 authored by pfdietz's avatar pfdietz

More tests of TYPE-OF. Moved some error tests to type-of.lsp from types-and-class.lsp

parent 43ca9233
......@@ -19,4 +19,50 @@
when failures collect (list x failures))
nil)
;;; 1. For any object that is an element of some built-in type:
;;; b. the type returned does not involve and, eql, member, not,
;;; or, satisfies, or values.
;;;
;;; Since every object is an element of the built-in type T, this
;;; applies universally.
(deftest type-of.2
(loop for x in *universe*
for tp = (type-of x)
when (and (consp tp)
(member (car tp) '(and eql member not or satisfies values
function)))
collect x)
nil)
(deftest type-of.3
(loop for x in *universe*
unless (typep x (type-of x))
collect x)
nil)
(deftest type-of.4
(loop for x in *universe*
for tp = (type-of x)
for class = (class-of x)
unless (equal (multiple-value-list (subtypep* tp class)) '(t t))
collect x)
nil)
(deftest type-of.5
(loop for x in *cl-condition-type-symbols*
for cnd = (make-condition x)
for tp = (type-of cnd)
unless (eq x tp)
collect x)
nil)
;;; Error tests
(deftest type-of.error.1
(classify-error (type-of))
program-error)
(deftest type-of.error.2
(classify-error (type-of nil nil))
program-error)
......@@ -283,13 +283,7 @@
;;; Error checking of type-related functions
(deftest type-of.error.1
(classify-error (type-of))
program-error)
(deftest type-of.error.2
(classify-error (type-of nil nil))
program-error)
(deftest typep.error.1
(classify-error (typep))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment