Commit 55e0efaf authored by pfdietz's avatar pfdietz
Browse files

Test of read-byte on echo streams

parent 359e6488
......@@ -29,6 +29,32 @@
(get-output-stream-string os)))
"foo" "foo")
;;; Tests of READ-BYTE on echo streams
(deftest make-echo-stream.4
(let ((pn #p"tmp.dat")
(pn2 #p"tmp2.dat")
(element-type '(unsigned-byte 8)))
(with-open-file (os pn
:direction :output
:element-type element-type
:if-exists :supersede)
(loop for x in '(2 3 5 7 11)
do (write-byte x os)))
(is pn :direction :input :element-type element-type)
(os pn2 :direction :output :if-exists :supersede
:element-type element-type)
(let ((s (make-echo-stream is os)))
(loop repeat 6 collect (read-byte s nil :eof1))))
(s pn2 :direction :input :element-type element-type)
(loop repeat 6 collect (read-byte s nil :eof2))))))
(2 3 5 7 11 :eof1)
(2 3 5 7 11 :eof2))
;;; More tests of stream functions on echo streams go here
;;; Error tests
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment