X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fprint.impure.lisp;h=81cb0f33cd72fcd7b94b1c01edd4dfd4e5d0295d;hb=9837343101c3da7b3a8f94609ec116ec5025436a;hp=608ce7fc36edb9cb04a985f8ac1e0a7d1eddfbaf;hpb=27844b49d7305379390dfbd78f114c46dcf74707;p=sbcl.git diff --git a/tests/print.impure.lisp b/tests/print.impure.lisp index 608ce7f..81cb0f3 100644 --- a/tests/print.impure.lisp +++ b/tests/print.impure.lisp @@ -414,7 +414,8 @@ (assert (string= (format nil (formatter "~:C") #\a) "a")) ;;; This used to trigger an AVER instead. -(assert (raises-error? (format t "~>") sb-format:format-error)) +(assert (raises-error? (eval '(formatter "~>")) sb-format:format-error)) +(assert (raises-error? (eval '(format t "~>")) sb-format:format-error)) ;;; readably printing hash-tables, check for circularity (let ((x (cons 1 2)) @@ -427,4 +428,23 @@ (assert (equal x x2)) (assert (eq h2 (gethash x2 h2))))) +;;; an off-by-one error in the ~R format directive until 1.0.15.20 +;;; prevented printing cardinals and ordinals between (expt 10 63) and +;;; (1- (expt 10 66)) +(assert (string= (format nil "~R" (expt 10 63)) "one vigintillion")) +(assert (string= (format nil "~:R" (expt 10 63)) "one vigintillionth")) + +;;; too-clever cacheing for PRINT-OBJECT resulted in a bogus method +;;; for printing RESTART objects. Check also CONTROL-STACK-EXHAUSTED +;;; and HEAP-EXHAUSTED-ERROR. +(let ((result (with-output-to-string (*standard-output*) + (princ (find-restart 'abort))))) + (assert (string/= result "#<" :end1 2))) +(let ((result (with-output-to-string (*standard-output*) + (princ (make-condition 'sb-kernel::control-stack-exhausted))))) + (assert (string/= result "#<" :end1 2))) +(let ((result (with-output-to-string (*standard-output*) + (princ (make-condition 'sb-kernel::heap-exhausted-error))))) + (assert (string/= result "#<" :end1 2))) + ;;; success