From fe5b6bebaa221e6816821c3261ad0a9481e15add Mon Sep 17 00:00:00 2001 From: Jim Blandy Date: Mon, 20 Sep 1999 23:57:08 +0000 Subject: [PATCH] * tests/ports.test: Check that our input functions cope when current-input-port is closed. --- test-suite/tests/ports.test | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.test index b07a2edfd..b5c0aeb23 100644 --- a/test-suite/tests/ports.test +++ b/test-suite/tests/ports.test @@ -352,3 +352,17 @@ (lambda () (pass-if "char-ready? returns true on string port as default port" (char-ready?)))))) + + +;;;; Close current-input-port, and make sure everyone can handle it. + +(with-test-prefix "closing current-input-port" + (for-each (lambda (procedure name) + (with-input-from-port + (call-with-input-string "foo" (lambda (p) p)) + (lambda () + (close-port (current-input-port)) + (pass-if name + (signals-error? 'wrong-type-arg (procedure)))))) + (list read read-char read-line) + '("read" "read-char" "read-line")))