From d1b143e9a3197c24838821f935404dd01941cb44 Mon Sep 17 00:00:00 2001 From: Gary Houston Date: Sun, 29 Aug 1999 17:48:26 +0000 Subject: [PATCH] 1999-08-29 Gary Houston * tests/ports.test: test unread-char and unread-string. --- test-suite/ChangeLog | 4 ++++ test-suite/tests/ports.test | 17 +++++++++++++++++ 2 files changed, 21 insertions(+) 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 + + * tests/ports.test: test unread-char and unread-string. + 1999-08-19 Gary Houston * 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. -- 2.20.1