X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Ftype.pure.lisp;h=a7708352c2f0f28161bd5112a967880c6564202e;hb=a7c2a16d0c2be6709becc962be1cb5e0aeda68c6;hp=9222e6a3701f5703f45af28e5fa3cef886c412ef;hpb=e62a03c99097db9454d66f32b5edbd6af874a539;p=sbcl.git diff --git a/tests/type.pure.lisp b/tests/type.pure.lisp index 9222e6a..a770835 100644 --- a/tests/type.pure.lisp +++ b/tests/type.pure.lisp @@ -42,7 +42,15 @@ array generic-function simple-error - ;; (NOT CONS) + ;; so it might seem easy to change the HAIRY + ;; :UNPARSE method to recognize that (NOT + ;; CONS) should unparse as ATOM. However, we + ;; then lose the nice (SUBTYPEP '(NOT ATOM) + ;; 'CONS) => T,T behaviour that we get from + ;; simplifying (NOT ATOM) -> (NOT (NOT CONS)) + ;; -> CONS. So, for now, we leave this + ;; commented out. + ;; ;; atom hash-table simple-string @@ -60,8 +68,7 @@ single-float bit-vector long-float - ;; MEMBER-TYPE #\a #\b ... - ;; standard-char + standard-char broadcast-stream method standard-class @@ -88,9 +95,7 @@ string condition pathname - ;; OR STRING-INPUT-STREAM STRING-OUTPUT-STREAM - ;; FILL-POINTER-OUTPUT-STREAM - ;; string-stream + string-stream cons print-not-readable structure-class @@ -121,6 +126,7 @@ ;; obviously disjoint types and then do (the ;; extended-char foo), we'll get back FOO is ;; not a NIL. -- CSR, 2002-09-16. + ;; ;; extended-char real type-error @@ -128,8 +134,7 @@ restart unbound-slot file-stream - ;; (OR CONS NULL VECTOR) - ;; sequence + sequence unbound-variable fixnum serious-condition @@ -151,3 +156,28 @@ (format t "~&~S~%" type) (assert (not (sb-kernel:unknown-type-p (sb-kernel:specifier-type type)))) (assert (atom (sb-kernel:type-specifier (sb-kernel:specifier-type type)))))) + +;;; a bug underlying the reported bug #221: The SB-KERNEL type code +;;; signalled an error on this expression. +(subtypep '(function (fixnum) (values package boolean)) + '(function (t) (values package boolean))) + +;;; bug reported by Valtteri Vuorik +(compile nil '(lambda () (member (char "foo" 0) '(#\. #\/) :test #'char=))) +(assert (not (equal (multiple-value-list + (subtypep '(function ()) '(function (&rest t)))) + '(nil t)))) + +(assert (not (equal (multiple-value-list + (subtypep '(function (&rest t)) '(function ()))) + '(t t)))) + +(assert (subtypep '(function) + '(function (&optional * &rest t)))) +(assert (equal (multiple-value-list + (subtypep '(function) + '(function (t &rest t)))) + '(nil t))) +#+nil +(assert (and (subtypep 'function '(function)) + (subtypep '(function) 'function)))