From: Alexey D. <ade...@us...> - 2005-02-21 19:19:50
|
Update of /cvsroot/sbcl/sbcl/tests In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2489/tests Modified Files: array.pure.lisp type.pure.lisp Log Message: 0.8.19.35: * Fix bug, found by Paul F. Dietz in (CTYPE-OF (COMPLEX <integer> <ratio>)). Index: array.pure.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/tests/array.pure.lisp,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- array.pure.lisp 20 Feb 2005 18:53:15 -0000 1.20 +++ array.pure.lisp 21 Feb 2005 19:17:59 -0000 1.21 @@ -181,10 +181,14 @@ (equal (array-dimension v1 0) (array-dimension v2 0)) (loop for i below (array-dimension v1 0) always (eql (aref v1 i) (aref v2 i)))))) - (let ((v1 (make-array 4 :element-type 'bit :fill-pointer 0 - :initial-contents '(0 0 1 1))) - (v2 (make-array 4 :element-type 'bit :fill-pointer 1 - :initial-contents '(0 0 1 1)))) + (let* ((length 1024) + (v1 (make-array length :element-type 'bit :fill-pointer 0)) + (v2 (make-array length :element-type 'bit :fill-pointer 1))) + (loop for i from 0 below length + for x1 in '#1=(0 0 1 1 . #1#) + and x2 in '#2=(0 1 0 1 . #2#) + do (setf (aref v1 i) x1) + do (setf (aref v2 i) x2)) (loop for (bf lf) in '((bit-and logand) (bit-andc1 logandc1) (bit-andc2 logandc2) @@ -201,7 +205,7 @@ (declare (optimize (speed 3) (safety 0))) (,bf v ,v2))) for r1 = (funcall fun v1) - and r2 = (coerce (loop for i below 4 + and r2 = (coerce (loop for i below length collect (logand 1 (funcall lf (aref v1 i) (aref v2 i)))) 'bit-vector) do (assert (bit-vector-equal r1 r2))))) Index: type.pure.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/tests/type.pure.lisp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- type.pure.lisp 2 Dec 2004 18:19:30 -0000 1.21 +++ type.pure.lisp 21 Feb 2005 19:18:09 -0000 1.22 @@ -227,3 +227,9 @@ '(real #.(ash -1 10000) #.(ash 1 10000)))) (assert (subtypep '(real (#.(ash -1 1000)) (#.(ash 1 1000))) '(real #.(ash -1 1000) #.(ash 1 1000)))) + +;;; Bug, found by Paul F. Dietz +(let* ((x (eval #c(-1 1/2))) + (type (type-of x))) + (assert (subtypep type '(complex rational))) + (assert (typep x type))) |