Skip to content
Snippets Groups Projects
Commit ad65af3a authored by pfdietz's avatar pfdietz
Browse files

Fixed some comments, and added assertions to check various stream functions on synonym streams.

parent 881e6f3d
No related branches found
No related tags found
No related merge requests found
...@@ -55,7 +55,7 @@ ...@@ -55,7 +55,7 @@
"This is a test") "This is a test")
;;; FIXME ;;; FIXME
;;; Add tests for: close, stream-element-type, ;;; Add tests for: close,
;;; peek-char, read-char-no-hang, terpri, fresh-line, unread-char, ;;; peek-char, read-char-no-hang, terpri, fresh-line, unread-char,
;;; read-line, write-line, write-string, read-sequence, write-sequence, ;;; read-line, write-line, write-string, read-sequence, write-sequence,
;;; read-byte, write-byte, listen, clear-input, finish-output, force-output, ;;; read-byte, write-byte, listen, clear-input, finish-output, force-output,
......
...@@ -13,6 +13,10 @@ ...@@ -13,6 +13,10 @@
(assert (typep ss 'stream)) (assert (typep ss 'stream))
(assert (typep ss 'synonym-stream)) (assert (typep ss 'synonym-stream))
(assert (input-stream-p ss)) (assert (input-stream-p ss))
(assert (not (output-stream-p ss)))
(assert (open-stream-p ss))
(assert (streamp ss))
(assert (stream-element-type ss))
(values (values
(read-char *s*) (read-char *s*)
(read-char ss) (read-char ss)
...@@ -30,6 +34,10 @@ ...@@ -30,6 +34,10 @@
(assert (typep ss 'stream)) (assert (typep ss 'stream))
(assert (typep ss 'synonym-stream)) (assert (typep ss 'synonym-stream))
(assert (input-stream-p ss)) (assert (input-stream-p ss))
(assert (not (output-stream-p ss)))
(assert (open-stream-p ss))
(assert (streamp ss))
(assert (stream-element-type ss))
(read-char ss))) (read-char ss)))
#\z) #\z)
...@@ -41,14 +49,31 @@ ...@@ -41,14 +49,31 @@
(assert (typep ss 'stream)) (assert (typep ss 'stream))
(assert (typep ss 'synonym-stream)) (assert (typep ss 'synonym-stream))
(assert (output-stream-p ss)) (assert (output-stream-p ss))
(assert (not (input-stream-p ss)))
(assert (open-stream-p ss))
(assert (streamp ss))
(assert (stream-element-type ss))
(write-char #\a *s*) (write-char #\a *s*)
(write-char #\b ss) (write-char #\b ss)
(write-char #\x *s*) (write-char #\x *s*)
(write-char #\y ss))) (write-char #\y ss)))
"abxy") "abxy")
(deftest make-synonym-stream.4
(let ((ss (make-synonym-stream '*terminal-io*)))
(assert (typep ss 'stream))
(assert (typep ss 'synonym-stream))
(assert (output-stream-p ss))
(assert (input-stream-p ss))
(assert (open-stream-p ss))
(assert (streamp ss))
(assert (stream-element-type ss))
nil)
nil)
;;; FIXME ;;; FIXME
;;; Add tests for: open-stream-p, close, stream-element-type, streamp, ;;; Add tests for: close,
;;; peek-char, read-char-no-hang, terpri, fresh-line, unread-char, ;;; peek-char, read-char-no-hang, terpri, fresh-line, unread-char,
;;; read-line, write-line, write-string, read-sequence, write-sequence, ;;; read-line, write-line, write-string, read-sequence, write-sequence,
;;; read-byte, write-byte, listen, clear-input, finish-output, force-output, ;;; read-byte, write-byte, listen, clear-input, finish-output, force-output,
......
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
#\f #\b #\o #\a #\o #\r "bar") #\f #\b #\o #\a #\o #\r "bar")
;;; FIXME ;;; FIXME
;;; Add tests for: close, stream-element-type, ;;; Add tests for: close,
;;; peek-char, read-char-no-hang, terpri, fresh-line, unread-char, ;;; peek-char, read-char-no-hang, terpri, fresh-line, unread-char,
;;; read-line, write-line, write-string, read-sequence, write-sequence, ;;; read-line, write-line, write-string, read-sequence, write-sequence,
;;; read-byte, write-byte, listen, clear-input, finish-output, force-output, ;;; read-byte, write-byte, listen, clear-input, finish-output, force-output,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment