X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Ftype.impure.lisp;h=02ee7f748c67ad78106d83f6f115742edfcb5e87;hb=414c64bc16680801257229b9b673f76a04b77cfd;hp=6e4a2e82b8339c4eedfed4f6ccd9c88cad1d4d44;hpb=07111ea2a4131f731f5ac23e79cb3d715970a92e;p=sbcl.git diff --git a/tests/type.impure.lisp b/tests/type.impure.lisp index 6e4a2e8..02ee7f7 100644 --- a/tests/type.impure.lisp +++ b/tests/type.impure.lisp @@ -109,6 +109,16 @@ (assert (raises-error? (typep 11 'eql))) (assert (raises-error? (typep 11 'satisfies))) (assert (raises-error? (typep 11 'not))) +;;; and while it doesn't specifically disallow illegal compound +;;; specifiers from the CL package, we don't have any. +(assert (raises-error? (subtypep 'fixnum '(fixnum 1)))) +(assert (raises-error? (subtypep 'class '(list)))) +(assert (raises-error? (subtypep 'foo '(ratio 1/2 3/2)))) +(assert (raises-error? (subtypep 'character '(character 10)))) +#+nil ; doesn't yet work on PCL-derived internal types +(assert (raises-error? (subtypep 'lisp '(class)))) +#+nil +(assert (raises-error? (subtypep 'bar '(method number number)))) ;;; Of course empty lists of subtypes are still OK. (assert (typep 11 '(and))) @@ -409,6 +419,14 @@ (t1 (sb-kernel:specifier-type s))) (eval `(defstruct ,s)) (sb-kernel:type= t1 (sb-kernel:specifier-type s)))) + +;;; bug found by PFD's random subtypep tester +(let ((t1 '(cons rational (cons (not rational) (cons integer t)))) + (t2 '(not (cons (integer 0 1) (cons single-float long-float))))) + (assert-t-t (subtypep t1 t2)) + (assert-nil-t (subtypep t2 t1)) + (assert-t-t (subtypep `(not ,t2) `(not ,t1))) + (assert-nil-t (subtypep `(not ,t1) `(not ,t2)))) ;;; success (quit :unix-status 104)