X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fstream.pure.lisp;h=2593683608a15f50a13aad0c0b3184d0c0111969;hb=aebbc5aad31f7e55930c996a8c54f0a135e00894;hp=b0af043b68a28224c6818d1c8b45a2aebf26c85f;hpb=1c347eae5ec81b6f41db9d27c1fe6d34abe1d3ca;p=sbcl.git diff --git a/tests/stream.pure.lisp b/tests/stream.pure.lisp index b0af043..2593683 100644 --- a/tests/stream.pure.lisp +++ b/tests/stream.pure.lisp @@ -14,7 +14,7 @@ (in-package :cl-user) ;;; Until sbcl-0.6.11.31, we didn't have an N-BIN method for -;;; CONCATENATED-STRING, so stuff like this would fail. +;;; CONCATENATED-STREAM, so stuff like this would fail. (let ((stream (make-concatenated-stream (make-string-input-stream "Demo"))) (buffer (make-string 4))) (read-sequence buffer stream)) @@ -52,5 +52,31 @@ (assert (< n-actually-read-1 n-to-read)) (return))))) -;;; success -(quit :unix-status 104) +;;; Entomotomy PEEK-CHAR-WRONGLY-ECHOS-TO-ECHO-STREAM bug, fixed by +;;; by MRD patch sbcl-devel 2002-11-02 merged ca. sbcl-0.7.9.32... +(assert (string= + (with-output-to-string (out) + (peek-char #\] + (make-echo-stream + (make-string-input-stream "ab cd e df s]") out))) + ;; (Before the fix, the result had a trailing #\] in it.) + "ab cd e df s")) +;;; ...and a missing wrinkle in the original patch, dealing with +;;; PEEK-CHAR/UNREAD-CHAR on ECHO-STREAMs, fixed by MRD patch +;;; sbcl-devel 2002-11-18, merged ca. sbcl-0.7.9.66 +(assert (string= + (let* ((in-stream (make-string-input-stream "abc")) + (out-stream (make-string-output-stream)) + (echo-stream (make-echo-stream in-stream out-stream))) + (unread-char (read-char echo-stream) echo-stream) + (peek-char #\a echo-stream) + (get-output-stream-string out-stream)) + ;; (Before the fix, the LET* expression just signalled an error.) + "a")) + +;; 0.7.12 doesn't advance current stream in concatenated streams +;; correctly when searching a stream for a char to read. +(with-input-from-string (p "") + (with-input-from-string (q "foo") + (let* ((r (make-concatenated-stream p q))) + (peek-char nil r))))