X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Ftype.before-xc.lisp;h=7bc61c5df067bfe1b2ad06d0d7e9305f7b6a6ccd;hb=8dc064d2296902f01afd9107e89a81146e3771fe;hp=e123ae1c26c47402b3cd4e969c572c06bbe54435;hpb=cbaa1997bb097a55d108df592ac3b7eb4a703fff;p=sbcl.git diff --git a/tests/type.before-xc.lisp b/tests/type.before-xc.lisp index e123ae1..7bc61c5 100644 --- a/tests/type.before-xc.lisp +++ b/tests/type.before-xc.lisp @@ -182,17 +182,34 @@ (assert (null (type-intersection2 (specifier-type 'symbol) (specifier-type '(satisfies foo))))) (assert (intersection-type-p (specifier-type '(and symbol (satisfies foo))))) -;; FIXME: As of sbcl-0.6.11.17, the system doesn't know how to do the -;; type simplifications which would let these tests work. (bug 88) -#| +(assert (ctypep :x86 (specifier-type '(satisfies keywordp)))) +(assert (type= (specifier-type '(member :x86)) + (specifier-type '(and (member :x86) (satisfies keywordp))))) (let* ((type1 (specifier-type '(member :x86))) (type2 (specifier-type '(or keyword null))) (isect (type-intersection type1 type2))) + (assert (type= isect type1)) (assert (type= isect (type-intersection type2 type1))) + (assert (type= isect (type-intersection type2 type1 type2))) + (assert (type= isect (type-intersection type1 type1 type2 type1))) + (assert (type= isect (type-intersection type1 type2 type1 type2)))) +(let* ((type1 (specifier-type 'keyword)) + (type2 (specifier-type '(or keyword null))) + (isect (type-intersection type1 type2))) (assert (type= isect type1)) + (assert (type= isect (type-intersection type2 type1))) (assert (type= isect (type-intersection type2 type1 type2))) (assert (type= isect (type-intersection type1 type1 type2 type1))) (assert (type= isect (type-intersection type1 type2 type1 type2)))) -|# +(assert (csubtypep (specifier-type '(or (single-float -1.0 1.0) + (single-float 0.1))) + (specifier-type '(or (real -1 7) + (single-float 0.1) + (single-float -1.0 1.0))))) +(assert (not (csubtypep (specifier-type '(or (real -1 7) + (single-float 0.1) + (single-float -1.0 1.0))) + (specifier-type '(or (single-float -1.0 1.0) + (single-float 0.1)))))) (/show "done with tests/type.before-xc.lisp")