X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fstream.impure.lisp;h=b6f022427d4e2ec10c4d1d391fe7f98e89197157;hb=765a042b5f968f285d8bd4a4ea1e897ca29abc8d;hp=57fb7eca615d185fa7e35ff81370722ac9784a25;hpb=8151587cdfac76dfdebe98caf4790839ff5aaa38;p=sbcl.git diff --git a/tests/stream.impure.lisp b/tests/stream.impure.lisp index 57fb7ec..b6f0224 100644 --- a/tests/stream.impure.lisp +++ b/tests/stream.impure.lisp @@ -642,7 +642,7 @@ #-win32 (require :sb-posix) #-win32 -(with-test (:name :overager-character-buffering) +(with-test (:name :overeager-character-buffering) (let ((fifo nil) (proc nil)) (maphash @@ -652,7 +652,7 @@ (finish-output t) (unwind-protect (progn - (setf fifo (sb-posix:mktemp "SBCL-fifo-XXXXXXX.tmp")) + (setf fifo (sb-posix:mktemp "SBCL-fifo-XXXXXXX")) (sb-posix:mkfifo fifo (logior sb-posix:s-iwusr sb-posix:s-irusr)) ;; KLUDGE: because we have both ends in the same process, we would ;; need to use O_NONBLOCK, but this works too. @@ -675,4 +675,35 @@ (setf fifo nil)))) sb-impl::*external-formats*))) +(with-test (:name :bug-657183) + (let ((name (merge-pathnames "stream-impure.temp-test")) + (text '(#\GREEK_SMALL_LETTER_LAMDA + #\JAPANESE_BANK_SYMBOL + #\Space + #\HEAVY_BLACK_HEART)) + (positions '(2 5 6 9)) + (sb-impl::*default-external-format* :utf-8)) + (unwind-protect + (progn + (with-open-file (f name :external-format :default :direction :output + :if-exists :supersede) + (assert (eql 0 (file-position f))) + (mapc (lambda (char pos) + (write-char char f) + (assert (eql pos (file-position f)))) + text + positions)) + (with-open-file (f name :external-format :default :direction :input) + (assert (eql 0 (file-position f))) + (assert (eql (pop text) (read-char f))) + (assert (eql (file-position f) 2)) + (assert (eql (pop text) (read-char f))) + (assert (eql (file-position f) 5)) + (assert (eql (pop text) (read-char f))) + (assert (eql (file-position f) 6)) + (assert (eql (pop text) (read-char f))) + (assert (eql (file-position f) 9)) + (assert (eql (file-length f) 9)))) + (ignore-errors (delete-file name))))) + ;;; success