0.6.11.11:
[sbcl.git] / tests / type.impure.lisp
index 2e52965..1dbf49c 100644 (file)
 (assert-nil-nil (subtypep '(vector utype-1) '(vector t)))
 (assert-nil-nil (subtypep '(vector t) '(vector utype-2)))
 
+;;; ANSI specifically disallows bare AND and OR symbols as type specs.
+#| ; Alas, this is part of bug 10, still unfixed as of sbcl-0.6.11.10.
+(assert (raises-error? (typep 11 'and)))
+(assert (raises-error? (typep 11 'or)))
+|#
+;;; Of course empty lists of subtypes are still OK.
+(assert (typep 11 '(and)))
+(assert (not (typep 11 '(or))))
+
+;;; bug 12: type system didn't grok nontrivial intersections
+(assert (subtypep '(and symbol (satisfies keywordp)) 'symbol))
+(assert (not (subtypep '(and symbol (satisfies keywordp)) 'null)))
+#| ; "we gotta target, but you gotta be patient": 0.6.11.11 work in progress 
+(assert (subtypep 'keyword 'symbol))
+(assert (not (subtypep 'symbol 'keyword)))
+(assert (subtypep 'ratio 'real))
+(assert (subtypep 'ratio 'number))
+|#
+
 ;;; success
 (quit :unix-status 104)