X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fexternal-format.impure.lisp;h=3a96fb7f8e957971a3a8c3427d257b01e76adc9b;hb=fd79e33e6b6dacdc52cf6668a5bb7adf75aad6c1;hp=405fea1e1aed140ca63aea13698b6d39d36e264b;hpb=0c32d1e58d53715ce63fcc67abf540cefd3d5b0a;p=sbcl.git diff --git a/tests/external-format.impure.lisp b/tests/external-format.impure.lisp index 405fea1..3a96fb7 100644 --- a/tests/external-format.impure.lisp +++ b/tests/external-format.impure.lisp @@ -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))