X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=tests%2Fstream.impure.lisp;h=9b671c5c163cbb53f044823e11f19d61d5520c29;hb=0573ba54479d1d65e2c8a14daffd2976e249bf40;hp=8b5649d0413780f9c0f791bdae1c200c56ad1251;hpb=c6b35dc77f5b54857ffddf8f4a2b9493d7e8170f;p=sbcl.git diff --git a/tests/stream.impure.lisp b/tests/stream.impure.lisp index 8b5649d..9b671c5 100644 --- a/tests/stream.impure.lisp +++ b/tests/stream.impure.lisp @@ -76,5 +76,33 @@ (close stream) (delete-file p)) +(assert (raises-error? (read-byte (make-string-input-stream "abc")) + type-error)) +(assert (raises-error? (with-open-file (s "/dev/zero") + (read-byte s)) + type-error)) +;;; bidirectional streams getting confused about their position +(let ((p "bidirectional-stream-test")) + (with-open-file (s p :direction :output :if-exists :supersede) + (with-standard-io-syntax + (format s "~S ~S ~S~%" 'these 'are 'symbols))) + (with-open-file (s p :direction :io :if-exists :overwrite) + (read s) + (with-standard-io-syntax + (prin1 'insert s))) + (with-open-file (s p) + (assert (string= (read-line s) "THESE INSERTMBOLS"))) + (delete-file p)) + +;;; :DIRECTION :IO didn't work on non-existent pathnames +(let ((p "direction-io-test")) + (ignore-errors (delete-file p)) + (with-open-file (s p :direction :io) + (format s "1") + (finish-output s) + (file-position s :start) + (assert (char= (read-char s) #\1))) + (delete-file p)) + ;;; success (quit :unix-status 104)