summaryrefslogtreecommitdiff
path: root/test-suite
diff options
context:
space:
mode:
authorGary Houston <ghouston@arglist.com>1999-08-29 17:48:26 +0000
committerGary Houston <ghouston@arglist.com>1999-08-29 17:48:26 +0000
commitd1b143e9a3197c24838821f935404dd01941cb44 (patch)
treeab31164d16e890f711d7b2b91f9b8f7459493ea0 /test-suite
parent5c4fe34f92c54adc5187a0ca7defaa906ee573e9 (diff)
downloadguile-d1b143e9a3197c24838821f935404dd01941cb44.tar.gz
1999-08-29 Gary Houston <ghouston@easynet.co.uk>
* tests/ports.test: test unread-char and unread-string.
Diffstat (limited to 'test-suite')
-rw-r--r--test-suite/ChangeLog4
-rw-r--r--test-suite/tests/ports.test17
2 files changed, 21 insertions, 0 deletions
diff --git a/test-suite/ChangeLog b/test-suite/ChangeLog
index 175b81440..ea0059ec0 100644
--- a/test-suite/ChangeLog
+++ b/test-suite/ChangeLog
@@ -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.
diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.test
index ce796d11e..338741f49 100644
--- a/test-suite/tests/ports.test
+++ b/test-suite/tests/ports.test
@@ -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.