X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Ftype.pure.lisp;h=f472f249ab05f94f109b882670cd49d368b15642;hb=079ef9dad558ca07cb8178ef428bf738112174fa;hp=085ba7114c141f5fe439a9d69d80154c196c7a38;hpb=b20abacbe79a0b0da4f17389c06ec030a237da14;p=sbcl.git diff --git a/tests/type.pure.lisp b/tests/type.pure.lisp index 085ba71..f472f24 100644 --- a/tests/type.pure.lisp +++ b/tests/type.pure.lisp @@ -201,3 +201,29 @@ (dotimes (i 100) (let ((x (make-array 0 :element-type `(unsigned-byte ,(1+ i))))) (eval `(typep ,x (class-of ,x))))) + +(assert (not (typep #c(1 2) '(member #c(2 1))))) +(assert (typep #c(1 2) '(member #c(1 2)))) +(assert (subtypep 'nil '(complex nil))) +(assert (subtypep '(complex nil) 'nil)) +(assert (subtypep 'nil '(complex (eql 0)))) +(assert (subtypep '(complex (eql 0)) 'nil)) +(assert (subtypep 'nil '(complex (integer 0 0)))) +(assert (subtypep '(complex (integer 0 0)) 'nil)) +(assert (subtypep 'nil '(complex (rational 0 0)))) +(assert (subtypep '(complex (rational 0 0)) 'nil)) +(assert (subtypep 'complex '(complex real))) +(assert (subtypep '(complex real) 'complex)) +(assert (subtypep '(complex (eql 1)) '(complex (member 1 2)))) +(assert (subtypep '(complex ratio) '(complex rational))) +(assert (subtypep '(complex ratio) 'complex)) +(assert (equal (multiple-value-list + (subtypep '(complex (integer 1 2)) + '(member #c(1 1) #c(1 2) #c(2 1) #c(2 2)))) + '(nil t))) + +(assert (typep 0 '(real #.(ash -1 10000) #.(ash 1 10000)))) +(assert (subtypep '(real #.(ash -1 1000) #.(ash 1 1000)) + '(real #.(ash -1 10000) #.(ash 1 10000)))) +(assert (subtypep '(real (#.(ash -1 1000)) (#.(ash 1 1000))) + '(real #.(ash -1 1000) #.(ash 1 1000))))