X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Ftype.impure.lisp;h=4ce036367b6ce924b44afd211cf2a69e76c8699c;hb=bed279acc9bd04eb1bbf56acb0dcaa3b1acf04f0;hp=effe4a05edd6671c37e7ef361a316af20fff9eab;hpb=3b45a7b66afe95080562d266dd447b1286abece0;p=sbcl.git diff --git a/tests/type.impure.lisp b/tests/type.impure.lisp index effe4a0..4ce0363 100644 --- a/tests/type.impure.lisp +++ b/tests/type.impure.lisp @@ -70,7 +70,11 @@ ;;; part I: TYPEP (assert (typep #(11) '(simple-array t 1))) (assert (typep #(11) '(simple-array (or integer symbol) 1))) -;;; FIXME: broken by 0.pre7.15 #!-SB-INTERPRETER stuff +;;; FIXME: This is broken because of compiler bug 123: the compiler +;;; optimizes the type test to T, so it never gets a chance to raise a +;;; runtime error. (It used to work under the IR1 interpreter just +;;; because the IR1 interpreter doesn't try to optimize TYPEP as hard +;;; as the byte compiler does.) #+nil (assert (raises-error? (typep #(11) '(simple-array undef-type 1)))) (assert (not (typep 11 '(simple-array undef-type 1)))) ;;; part II: SUBTYPEP @@ -98,12 +102,12 @@ (assert (subtypep 'ratio 'real)) (assert (subtypep 'ratio 'number)) -;;;; Douglas Thomas Crosher rewrote the CMU CL type test system to allow -;;;; inline type tests for CONDITIONs and STANDARD-OBJECTs, and generally -;;;; be nicer, and Martin Atzmueller ported the patches. -;;;; They look nice but they're nontrivial enough that it's not obvious -;;;; from inspection that everything is OK. Let's make sure that things -;;;; still basically work. +;;;; Douglas Thomas Crosher rewrote the CMU CL type test system to +;;;; allow inline type tests for CONDITIONs and STANDARD-OBJECTs, and +;;;; generally be nicer, and Martin Atzmueller ported the patches. +;;;; They look nice but they're nontrivial enough that it's not +;;;; obvious from inspection that everything is OK. Let's make sure +;;;; that things still basically work. ;; structure type tests setup (defstruct structure-foo1) @@ -145,6 +149,10 @@ ;; structure type tests (assert (typep (make-structure-foo3) 'structure-foo2)) (assert (not (typep (make-structure-foo1) 'structure-foo4))) + (assert (typep (nth-value 1 + (ignore-errors (structure-foo2-x + (make-structure-foo1)))) + 'type-error)) (assert (null (ignore-errors (setf (structure-foo2-x (make-structure-foo1)) 11)))) @@ -192,8 +200,10 @@ (sb-pcl:class-direct-subclasses (sb-pcl:find-class 'simple-condition)) (mapcar #'sb-pcl:find-class - '(simple-type-error simple-error - sb-int:simple-style-warning))))) + '(simple-type-error + simple-error + sb-int:simple-file-error + sb-int:simple-style-warning))))) ;; precedence lists (assert (equal (sb-pcl:class-precedence-list