1999-08-29 Gary Houston <ghouston@easynet.co.uk>
* tests/ports.test: test unread-char and unread-string.
This commit is contained in:
parent
5c4fe34f92
commit
d1b143e9a3
2 changed files with 21 additions and 0 deletions
|
|
@ -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.
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue