X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fstream.impure.lisp;h=851990f688297ea68fc9379e80cfe48f01c7731c;hb=37200d73dfca16507809778574092cfb998711d5;hp=e6cb01c7abcd146c874e2e13d689962986ef3412;hpb=240d3c4a81b02196176795b82c263fed8dd3ddfe;p=sbcl.git diff --git a/tests/stream.impure.lisp b/tests/stream.impure.lisp index e6cb01c..851990f 100644 --- a/tests/stream.impure.lisp +++ b/tests/stream.impure.lisp @@ -497,5 +497,24 @@ (multiple-value-list (read-line in nil nil)))))) (delete-file pathname) (assert (equal result '(("a" nil) ("b" t) (nil t)))))) + +;;; READ-LINE used to work on closed streams because input buffers were left in place +(with-test (:name :bug-425) + ;; Normal close + (let ((f (open "stream.impure.lisp" :direction :input))) + (assert (stringp (read-line f))) + (close f) + (assert (eq :fii + (handler-case + (read-line f) + (sb-int:closed-stream-error () :fii))))) + ;; Abort + (let ((f (open "stream.impure.lisp" :direction :input))) + (assert (stringp (read-line f nil nil))) + (close f :abort t) + (assert (eq :faa + (handler-case + (read-line f) + (sb-int:closed-stream-error () :faa)))))) ;;; success