Improve R6RS conformance wrt. conditions in the I/O libraries
authorAndreas Rottmann <a.rottmann@gmx.at>
Sat, 14 May 2011 17:29:26 +0000 (19:29 +0200)
committerAndreas Rottmann <a.rottmann@gmx.at>
Sat, 14 May 2011 17:29:26 +0000 (19:29 +0200)
commitb6a66c21fc3791bb5ea50f6e7a0ccc2e8f55e27a
tree6bdcb9bcd01bbc0fc2fbca5aaa2b0ef0bff79022
parent2002f1f84797c2c46d0634eabd5ac5fd61e13d73
Improve R6RS conformance wrt. conditions in the I/O libraries

* module/rnrs/io/ports.scm (open-file-output-port): Handle `no-fail'
  file option.
  (with-i/o-filename-conditions): Use `with-throw-handler' instead of `catch'.
  (with-i/o-port-error,
  with-textual-output-conditions. with-textual-input-conditions): New
  exception-conversion helpers.
  (put-char, put-datum, put-string, display): Use
  `with-textual-output-conditions' instead of `with-i/o-encoding-error'
  to get proper conditions in case of write errors.
  (get-char, get-datum, get-line, get-string-all, lookahead-char):
  Likewise, for the input case.

* test-suite/tests/r6rs-ports.test (pass-if-condition, test-file,
  make-failing-port): New helpers.
  ("8.2.10 Output ports"): Add some tests for `open-file-output-port'.
  ("8.2.9 Textual Input"): Add tests read error conditions.
  ("8.2.12 Textual Output"): Add tests for write error conditions.
  ("8.3 Simple I/O"): Add tests for conditions, `call-with-input-file'
  and `call-with-output-file'.
module/rnrs/io/ports.scm
test-suite/tests/r6rs-ports.test