X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Ftype.before-xc.lisp;h=1b1f0e2c5f30ca0bfb4b6e9d48d226c26162de9b;hb=260de2062fca170efdac3e42491d7d866c2d2e56;hp=3f8639e16716d5974e754705c209b5c4a676dfc8;hpb=0aecc2b20142e08068c3434273500131cb13fe2d;p=sbcl.git diff --git a/tests/type.before-xc.lisp b/tests/type.before-xc.lisp index 3f8639e..1b1f0e2 100644 --- a/tests/type.before-xc.lisp +++ b/tests/type.before-xc.lisp @@ -54,6 +54,12 @@ (assert (type= (specifier-type 'cons) (type-intersection (specifier-type 'sequence) (specifier-type '(or cons number))))) +(assert (type= (specifier-type '(simple-array character (*))) + (type-intersection (specifier-type 'sequence) + (specifier-type '(simple-array character))))) +(assert (type= (specifier-type 'list) + (type-intersection (specifier-type 'sequence) + (specifier-type 'list)))) (assert (eql *empty-type* (type-intersection (specifier-type '(satisfies keywordp)) *empty-type*))) @@ -62,8 +68,10 @@ (type-union (specifier-type 'cons) (specifier-type 'null)))) (assert (type= (specifier-type 'list) (type-union (specifier-type 'null) (specifier-type 'cons)))) +#+nil ; not any more (assert (type= (specifier-type 'sequence) (type-union (specifier-type 'list) (specifier-type 'vector)))) +#+nil ; not any more (assert (type= (specifier-type 'sequence) (type-union (specifier-type 'vector) (specifier-type 'list)))) (assert (type= (specifier-type 'list) @@ -283,5 +291,53 @@ (sb-xc:subtypep '(function) '(function (t &rest t))) (assert (not yes)) (assert win)) +;; Used to run out of stack. +(multiple-value-bind (yes win) + (sb-xc:subtypep 'null '(or unk0 unk1)) + (assert (not yes)) + (assert (not win))) + +(multiple-value-bind (yes win) + (sb-xc:subtypep '(and function instance) nil) + (assert yes) + (assert win)) +(multiple-value-bind (yes win) + (sb-xc:subtypep nil '(and function instance)) + (assert yes) + (assert win)) +(multiple-value-bind (yes win) + (sb-xc:subtypep '(and function funcallable-instance) 'funcallable-instance) + (assert yes) + (assert win)) +(multiple-value-bind (yes win) + (sb-xc:subtypep 'funcallable-instance '(and function funcallable-instance)) + (assert yes) + (assert win)) +(multiple-value-bind (yes win) + (sb-xc:subtypep 'stream 'instance) + (assert (not yes))) +(multiple-value-bind (yes win) + (sb-xc:subtypep 'stream 'funcallable-instance) + (assert (not yes)) + (assert win)) +(multiple-value-bind (yes win) + (sb-xc:subtypep '(and stream instance) 'instance) + (assert yes) + (assert win)) +(multiple-value-bind (yes win) + (sb-xc:subtypep '(and stream funcallable-instance) 'funcallable-instance) + (assert yes) + (assert win)) +(multiple-value-bind (yes win) + (sb-xc:subtypep '(and stream instance) 'stream) + (assert yes) + (assert win)) +(multiple-value-bind (yes win) + (sb-xc:subtypep '(and stream funcallable-instance) 'stream) + (assert yes) + (assert win)) + +(assert (type= (specifier-type 'nil) + (specifier-type '(and symbol funcallable-instance)))) (/show "done with tests/type.before-xc.lisp")