1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-17 01:00:20 +02:00

Simplify `scm_i_set_port_encoding_x'.

* libguile/ports.c (find_valid_encoding): Remove.
  (scm_i_set_port_encoding_x): Remove call to `find_valid_encoding'.
  Remove `valid_enc'.  Rename `enc' to `encoding'.

* test-suite/tests/ports.test ("port-encoding"): New test prefix.
This commit is contained in:
Ludovic Courtès 2011-02-10 22:27:37 +01:00
parent fe949e7bc6
commit 064c27c4ef
2 changed files with 26 additions and 51 deletions

View file

@ -783,6 +783,17 @@
(set-port-line! port n)
(eqv? n (port-line port)))))
(with-test-prefix "port-encoding"
(pass-if-exception "set-port-encoding!, wrong encoding"
exception:miscellaneous-error
(set-port-encoding! (open-input-string "") "does-not-exist"))
(pass-if-exception "%default-port-encoding, wrong encoding"
exception:miscellaneous-error
(read (with-fluids ((%default-port-encoding "does-not-exist"))
(open-input-string "")))))
;;;
;;; port-for-each
;;;