diff options
author | Jim Blandy <jimb@red-bean.com> | 1999-06-09 09:42:15 +0000 |
---|---|---|
committer | Jim Blandy <jimb@red-bean.com> | 1999-06-09 09:42:15 +0000 |
commit | 0b8faa0eb6a362303eb40652093e5b4ebd894bdf (patch) | |
tree | f9b3efc2fe97316835976f4f75d6f63f22332538 /test-suite | |
parent | 5157b4a518b8756112760a403f19bd44e384b5d6 (diff) | |
download | guile-0b8faa0eb6a362303eb40652093e5b4ebd894bdf.tar.gz |
* tests/ports.test ("line counter"): Verify that we do eventually
get EOF on the port --- don't just read forever.
Diffstat (limited to 'test-suite')
-rw-r--r-- | test-suite/tests/ports.test | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.test index 4b6ab500a..c36e3b443 100644 --- a/test-suite/tests/ports.test +++ b/test-suite/tests/ports.test @@ -171,9 +171,12 @@ (equal? (read-line port) second-line)) (pass-if "read-line increments line number" (= (port-line port) 2)) - (let loop () - (if (not (eof-object? (read-line port))) - (loop))) + (pass-if "read-line returns EOF" + (let loop ((i 0)) + (cond + ((eof-object? (read-line port)) #t) + ((> i 20) #f) + (else (loop (+ i 1)))))) (pass-if "line count is 5 at EOF" (= (port-line port) 5)))) ports port-list-names) |