0.8.16.10:
[sbcl.git] / tests / type.before-xc.lisp
index 2ae2937..90d8f1d 100644 (file)
   (assert-secondnil (sb-xc:subtypep t '(satisfies foo)))
   (assert-secondnil (sb-xc:subtypep t '(and (satisfies foo) (satisfies bar))))
   (assert-secondnil (sb-xc:subtypep t '(or (satisfies foo) (satisfies bar))))
-  ;; FIXME: Enable these tests when bug 84 is fixed.
-  #|
   (assert-secondnil (sb-xc:subtypep '(satisfies foo) nil))
   (assert-secondnil (sb-xc:subtypep '(and (satisfies foo) (satisfies bar))
                                    nil))
   (assert-secondnil (sb-xc:subtypep '(or (satisfies foo) (satisfies bar))
-                                   nil))
-  |#)
+                                   nil)))
 
 ;;; tests of 2-value quantifieroids FOO/TYPE
 (macrolet ((2= (v1 v2 expr2)
 (assert (null (type-intersection2 (specifier-type 'symbol)
                                  (specifier-type '(satisfies foo)))))
 (assert (intersection-type-p (specifier-type '(and symbol (satisfies foo)))))
+(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 (type-intersection type2 type1 type2)))
   (assert (type= isect (type-intersection type1 type1 type2 type1)))
   (assert (type= isect (type-intersection type1 type2 type1 type2))))
-;;; FIXME: As of sbcl-0.6.11.19, the system doesn't know how to do the
-;;; type simplifications which would let these tests work. (bug 89)
-#|
 (let* ((type1 (specifier-type 'keyword))
        (type2 (specifier-type '(or keyword null)))
        (isect (type-intersection type1 type2)))
   (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))))))
+
+(assert (sb-xc:typep #\, 'character))
+(assert (sb-xc:typep #\@ 'character))
+
+(assert (type= (type-intersection (specifier-type '(member #\a #\c #\e))
+                                 (specifier-type '(member #\b #\c #\f)))
+              (specifier-type '(member #\c))))
 
 (/show "done with tests/type.before-xc.lisp")