X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fexternal-format.impure.lisp;h=78285f71b05019c10a03fe2d62534323dc3ccdfe;hb=4363cb61eb8e2dc833070da398864a039210e1c8;hp=405fea1e1aed140ca63aea13698b6d39d36e264b;hpb=0c32d1e58d53715ce63fcc67abf540cefd3d5b0a;p=sbcl.git diff --git a/tests/external-format.impure.lisp b/tests/external-format.impure.lisp index 405fea1..78285f7 100644 --- a/tests/external-format.impure.lisp +++ b/tests/external-format.impure.lisp @@ -17,9 +17,9 @@ (defmacro do-external-formats ((xf &optional result) &body body) (let ((nxf (gensym))) - `(dolist (,nxf sb-impl::*external-formats* ,result) - (let ((,xf (first (first ,nxf)))) - ,@body)))) + `(loop for ,nxf being the hash-values of sb-impl::*external-formats* + do (let ((,xf (first (sb-impl::ef-names ,nxf)))) + ,@body)))) (defvar *test-path* "external-format-test.tmp") @@ -287,6 +287,23 @@ (values))) (delete-file *test-path*) +;;; We used to call STREAM-EXTERNAL-FORMAT on the stream in the error +;;; when printing a coding error, but that didn't work if the stream +;;; was closed by the time the error was printed. See sbcl-devel +;;; "Subject: Printing coding errors for closed streams" by Zach Beane +;;; on 2008-10-16 for more info. +(with-test (:name (:character-coding-error-stream-external-format)) + (flet ((first-file-character () + (with-open-file (stream *test-path* :external-format :utf-8) + (read-char stream)))) + (with-open-file (stream *test-path* + :direction :output + :if-exists :supersede + :element-type '(unsigned-byte 8)) + (write-byte 192 stream)) + (princ-to-string (nth-value 1 (ignore-errors (first-file-character)))))) +(delete-file *test-path*) + ;;; External format support in SB-ALIEN (with-test (:name (:sb-alien :vanilla))