1999-08-29 Gary Houston <ghouston@easynet.co.uk>

* tests/ports.test: test unread-char and unread-string.
This commit is contained in:
Gary Houston 1999-08-29 17:48:26 +00:00
commit d1b143e9a3
2 changed files with 21 additions and 0 deletions

View file

@ -1,3 +1,7 @@
1999-08-29 Gary Houston <ghouston@easynet.co.uk>
* tests/ports.test: test unread-char and unread-string.
1999-08-19 Gary Houston <ghouston@easynet.co.uk>
* tests/ports.test: test line-buffering of fports.

View file

@ -150,6 +150,23 @@
(string=? line test-string)))
(delete-file filename)))
;;; ungetting characters and strings.
(catch-test-errors
(with-input-from-string "walk on the moon\nmoon"
(lambda ()
(read-char)
(unread-char #\a (current-input-port))
(pass-if "unread-char"
(char=? (read-char) #\a))
(read-line)
(let ((replacenoid "chicken enchilada"))
(unread-char #\newline (current-input-port))
(unread-string replacenoid (current-input-port))
(pass-if "unread-string"
(string=? (read-line) replacenoid)))
(pass-if "unread residue"
(string=? (read-line) "moon")))))
;;;; Pipe ports.