From: Christophe Rhodes Date: Mon, 4 Apr 2005 09:49:43 +0000 (+0000) Subject: 0.8.21.16: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=5cd0fc84df83d1b3321b7fc969843207721de429;p=sbcl.git 0.8.21.16: Merge Teemu Kalvas' latest patch; ... add a terribly minimal test file for external-format issues --- diff --git a/src/code/fd-stream.lisp b/src/code/fd-stream.lisp index 9dd5f06..89bc127 100644 --- a/src/code/fd-stream.lisp +++ b/src/code/fd-stream.lisp @@ -1177,12 +1177,14 @@ nil)) (setf (fd-stream-ibuf-head stream) head) (when (and decode-break-reason - (= head head-start) - (stream-decoding-error-and-handle - stream decode-break-reason)) - (if eof-error-p - (error 'end-of-file :stream stream) - (return-from ,in-function total-copied))) + (= head head-start)) + (when (stream-decoding-error-and-handle + stream decode-break-reason) + (if eof-error-p + (error 'end-of-file :stream stream) + (return-from ,in-function total-copied))) + (setf head (fd-stream-ibuf-head stream)) + (setf tail (fd-stream-ibuf-tail stream))) (when (plusp total-copied) (return-from ,in-function total-copied))) (setf (fd-stream-ibuf-head stream) head) diff --git a/tests/external-format.impure.lisp b/tests/external-format.impure.lisp new file mode 100644 index 0000000..9673578 --- /dev/null +++ b/tests/external-format.impure.lisp @@ -0,0 +1,43 @@ +;;;; This file is for testing external-format functionality, using +;;;; test machinery which might have side effects (e.g. executing +;;;; DEFUN, writing files). Note that the tests here reach into +;;;; unexported functionality, and should not be used as a guide for +;;;; users. + +;;;; This software is part of the SBCL system. See the README file for +;;;; more information. +;;;; +;;;; While most of SBCL is derived from the CMU CL system, the test +;;;; files (like this one) were written from scratch after the fork +;;;; from CMU CL. +;;;; +;;;; This software is in the public domain and is provided with +;;;; absolutely no warranty. See the COPYING and CREDITS files for +;;;; more information. + +(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)))) + +(do-external-formats (xf) + (with-open-file (s "/dev/null" :direction :input :external-format xf) + (assert (eq (read-char s nil s) s)))) + +(let ((s (open "external-format-test.lisp" :direction :output + :if-exists :supersede :external-format :latin-1))) + (unwind-protect + (progn + (write-string ";;; ABCD" s) + (write-char (code-char 233) s) + (terpri s) + (close s) + (compile-file "external-format-test.lisp" :external-format :utf-8)) + (delete-file s) + (let ((p (probe-file (compile-file-pathname "external-format-test.lisp")))) + (when p + (delete-file p))))) + +(sb-ext:quit :unix-status 104) + \ No newline at end of file diff --git a/version.lisp-expr b/version.lisp-expr index 42f8404..3188f64 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.21.15" +"0.8.21.16"