mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 13:49:17 +02:00
Checking errors on reading/writing from/to closed ports.
This commit is contained in:
parent
f24eef289c
commit
cfe0a6f635
1 changed files with 10 additions and 0 deletions
|
@ -1817,6 +1817,16 @@
|
||||||
(close-port out)
|
(close-port out)
|
||||||
(output-port-open? out)))
|
(output-port-open? out)))
|
||||||
|
|
||||||
|
(test 'error
|
||||||
|
(let ((in (open-input-string "abc")))
|
||||||
|
(close-input-port in)
|
||||||
|
(guard (exn (else 'error)) (read-char in))))
|
||||||
|
|
||||||
|
(test 'error
|
||||||
|
(let ((out (open-output-string)))
|
||||||
|
(close-output-port out)
|
||||||
|
(guard (exn (else 'error)) (write-char #\c out))))
|
||||||
|
|
||||||
(test #t (eof-object? (eof-object)))
|
(test #t (eof-object? (eof-object)))
|
||||||
(test #t (eof-object? (read (open-input-string ""))))
|
(test #t (eof-object? (read (open-input-string ""))))
|
||||||
(test #t (char-ready? (open-input-string "42")))
|
(test #t (char-ready? (open-input-string "42")))
|
||||||
|
|
Loading…
Add table
Reference in a new issue