X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fstream.pure.lisp;h=70fc40db65cae6ff7296682eca403edc7c70ded9;hb=541c9393cf9d9b61271c5f087020d34547603a34;hp=845c87e2d11cce9c039b3fce06a3a9848cd1e281;hpb=f3ea7a91cddd3ce35290ddd4e54abbe8a7a3a452;p=sbcl.git diff --git a/tests/stream.pure.lisp b/tests/stream.pure.lisp index 845c87e..70fc40d 100644 --- a/tests/stream.pure.lisp +++ b/tests/stream.pure.lisp @@ -53,7 +53,7 @@ (return))))) ;;; 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 +;;; by MRD patch sbcl-devel 2002-11-02 merged ca. sbcl-0.7.9.32... (assert (string= (with-output-to-string (out) (peek-char #\] @@ -61,3 +61,32 @@ (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)))) + +;; 0.7.14 and previous SBCLs don't have a working INTERACTIVE-STREAM-P +;; because it called UNIX-ISATTY, which wasn't defined. +(with-input-from-string (s "a non-interactive stream") + (assert (not (interactive-stream-p s)))) +;;; KLUDGE: Unfortunately it's hard to find a reliably interactive +;;; stream to test, since it's reasonable for these tests to be run +;;; from a script, conceivably even as something like a cron job. +;;; Ideas? +#+nil (assert (eq (interactive-stream-p *terminal-io*) t))