3 ;;; We should be able to output X readably (at least when *READ-EVAL*).
4 (defun assert-readable-output (x)
7 (read-from-string (with-output-to-string (s)
8 (write x :stream s :readably t)))))))
10 ;;; Even when *READ-EVAL* is NIL, we should be able to output some
11 ;;; (not necessarily readable) representation without signalling an
13 (defun assert-unreadable-output (x)
14 (let ((*read-eval* nil))
15 (with-output-to-string (s) (write x :stream s :readably nil))))
17 (defun assert-output (x)
18 (assert-readable-output x)
19 (assert-unreadable-output x))
21 ;;; Nathan Froyd reported that sbcl-0.6.11.34 screwed up output of
22 ;;; floating point infinities.
23 (dolist (x (list short-float-positive-infinity short-float-negative-infinity
24 single-float-positive-infinity single-float-negative-infinity
25 double-float-positive-infinity double-float-negative-infinity
26 long-float-positive-infinity long-float-negative-infinity))
29 ;;; Eric Marsden reported that this would blow up in CMU CL (even
30 ;;; though ANSI says that the mismatch between ~F expected type and
31 ;;; provided string type is supposed to be handled without signalling
32 ;;; an error) and provided a fix which was ported to sbcl-0.6.12.35.
33 (assert (null (format t "~F" "foo")))
35 ;;; This was a bug in SBCL until 0.6.12.40 (originally reported as a
36 ;;; CMU CL bug by Erik Naggum on comp.lang.lisp).
37 (loop for *print-base* from 2 to 36
38 with *print-radix* = t
40 (assert (string= "#*101" (format nil "~S" #*101))))
43 (quit :unix-status 104)