0.9.4.54:
[sbcl.git] / tests / type.before-xc.lisp
index e7f0964..3f8639e 100644 (file)
                                  (specifier-type '(member #\b #\c #\f)))
               (specifier-type '(member #\c))))
 
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep 'package 'instance)
+  (assert yes)
+  (assert win))
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep 'symbol 'instance)
+  (assert (not yes))
+  (assert win))
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep 'package 'funcallable-instance)
+  (assert (not yes))
+  (assert win))
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep 'symbol 'funcallable-instance)
+  (assert (not yes))
+  (assert win))
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep 'funcallable-instance 'function)
+  (assert yes)
+  (assert win))
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep 'array 'instance)
+  (assert (not yes))
+  (assert win))
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep 'character 'instance)
+  (assert (not yes))
+  (assert win))
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep 'number 'instance)
+  (assert (not yes))
+  (assert win))
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep 'package '(and (or symbol package) instance))
+  (assert yes)
+  (assert win))
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep '(and (or double-float integer) instance) 'nil)
+  (assert yes)
+  (assert win))
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep '(and (or double-float integer) funcallable-instance) 'nil)
+  (assert yes)
+  (assert win))
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep 'instance 'type-specifier)
+  (assert yes)
+  (assert win))
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep 'type-specifier 'instance)
+  (assert (not yes))
+  (assert win))
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep '(and (function (t)) funcallable-instance) 'nil)
+  (assert (not yes)))
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep '(and fixnum function) 'nil)
+  (assert yes)
+  (assert win))
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep '(and fixnum hash-table) 'nil)
+  (assert yes)
+  (assert win))
+(multiple-value-bind (yes win)
+    (sb-xc:subtypep '(function) '(function (t &rest t)))
+  (assert (not yes))
+  (assert win))
+
 (/show "done with tests/type.before-xc.lisp")