X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fprint.impure.lisp;h=f7f3d1462ef4106a313da7ad9fe7539a5f7dfe72;hb=22bb62c99eda1ba3a5e423687ca77458e55dfed3;hp=b592d8490b671ded56b943f4e931f3fa770797fc;hpb=0957d59ccfaf3db9aaf79a7f4909a40ea0ca0dcd;p=sbcl.git diff --git a/tests/print.impure.lisp b/tests/print.impure.lisp index b592d84..f7f3d14 100644 --- a/tests/print.impure.lisp +++ b/tests/print.impure.lisp @@ -48,10 +48,10 @@ ;;; This was a bug in SBCL until 0.6.12.40 (originally reported as a ;;; CMU CL bug by Erik Naggum on comp.lang.lisp). -(loop for *print-base* from 2 to 36 +(loop for base from 2 to 36 with *print-radix* = t - do - (assert (string= "#*101" (format nil "~S" #*101)))) + do (let ((*print-base* base)) + (assert (string= "#*101" (format nil "~S" #*101))))) ;;; bug in sbcl-0.7.1.25, reported by DB sbcl-devel 2002-02-25 (assert (string= "0.5" (format nil "~2D" 0.5))) @@ -103,5 +103,24 @@ (assert (raises-error? (format nil "~<~<~A~:>~>" '(foo)))) (assert (string= (format nil "~<~<~A~>~>" 'foo) "FOO")) +;;; Check that arrays that we print while *PRINT-READABLY* is true are +;;; in fact generating similar objects. +(assert (equal (array-dimensions + (read-from-string + (with-output-to-string (s) + (let ((*print-readably* t)) + (print (make-array '(1 2 0)) s))))) + '(1 2 0))) + +(assert (multiple-value-bind (result error) + (ignore-errors (read-from-string + (with-output-to-string (s) + (let ((*print-readably* t)) + (print (make-array '(1 0 1)) s))))) + ;; it might not be readably-printable + (or (typep error 'print-not-readable) + ;; or else it had better have the same dimensions + (equal (array-dimensions result) '(1 0 1))))) + ;;; success (quit :unix-status 104)