X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fprint.impure.lisp;h=9a3a2c3132c8f8ed0ed776a8bb2f3fc2d3758892;hb=97eb3923d01211622a8be3b60f1afe4dfd217901;hp=510a6b116b28954b6f0cf84a38525cd13a980771;hpb=05b94d58e3d7f86d8b7f4b5fc224d72765004aaf;p=sbcl.git diff --git a/tests/print.impure.lisp b/tests/print.impure.lisp index 510a6b1..9a3a2c3 100644 --- a/tests/print.impure.lisp +++ b/tests/print.impure.lisp @@ -213,5 +213,31 @@ (let ((answer (write-to-string '(bar foo :boo 1) :pretty t :escape t))) (assert (string= answer "(?BAR? ?FOO? ?:BOO? ?1?)"))))) +;;; FORMAT string compile-time checker failure, reported by Thomas +;;; F. Burdick +(multiple-value-bind (f w-p f-p) + (compile nil '(lambda () (format nil "~{"))) + (assert (and w-p f-p)) + (assert (nth-value 1 (ignore-errors (funcall f))))) + +;;; floating point print/read consistency +(let ((x (/ -9.349640046247849d-21 -9.381494249123696d-11))) + (let ((y (read-from-string (write-to-string x :readably t)))) + (assert (eql x y)))) + +(let ((x1 (float -5496527/100000000000000000)) + (x2 (float -54965272/1000000000000000000))) + (assert (or (equal (multiple-value-list (integer-decode-float x1)) + (multiple-value-list (integer-decode-float x2))) + (string/= (prin1-to-string x1) (prin1-to-string x2))))) + +;;; readable printing of arrays with *print-radix* t +(let ((*print-radix* t) + (*print-readably* t) + (*print-pretty* nil)) + (let ((output (with-output-to-string (s) + (write #2a((t t) (nil nil)) :stream s)))) + (assert (equalp (read-from-string output) #2a((t t) (nil nil)))))) + ;;; success (quit :unix-status 104)