summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark H Weaver <mhw@netris.org>2019-04-19 03:09:37 -0400
committerAndy Wingo <wingo@pobox.com>2019-05-23 17:48:55 +0200
commitc6692a4825795494cedfab475b89d2efddc3a24e (patch)
tree1e86b2e25faf0156cc2814f917274dba07a10483
parent66ffd93dcf6becb325c467e7c80c035677132e59 (diff)
downloadguile-c6692a4825795494cedfab475b89d2efddc3a24e.tar.gz
Avoid 'with-latin1-locale' in binary I/O tests.
* test-suite/tests/r6rs-ports.test ("put-bytevector [2 args]") ("put-bytevector [3 args]", "put-bytevector [4 args]"): Set the default port encoding instead of setting the locale.
-rw-r--r--test-suite/tests/r6rs-ports.test15
1 files changed, 7 insertions, 8 deletions
diff --git a/test-suite/tests/r6rs-ports.test b/test-suite/tests/r6rs-ports.test
index e6ee10add..5b46cccd2 100644
--- a/test-suite/tests/r6rs-ports.test
+++ b/test-suite/tests/r6rs-ports.test
@@ -243,14 +243,13 @@
(put-u8 port 77)
(equal? (get-u8 port) 77)))
- ;; Note: The `put-bytevector' tests below require a Latin-1 locale so
- ;; that the `scm_from_locale_stringn' call in `sf_write' will let all
- ;; the bytes through, unmodified. This is hacky, but we can't use
- ;; "custom binary output ports" here because they're only tested
- ;; later.
+ ;; Note: The `put-bytevector' tests below temporarily set the default
+ ;; port encoding to ISO-8859-1 so that the soft-port will let all the
+ ;; bytes through, unmodified. This is hacky, but we can't use "custom
+ ;; binary output ports" here because they're only tested later.
(pass-if "put-bytevector [2 args]"
- (with-latin1-locale
+ (with-fluids ((%default-port-encoding "ISO-8859-1"))
(let ((port (make-soft-output-port))
(bv (make-bytevector 256)))
(put-bytevector port bv)
@@ -259,7 +258,7 @@
(get-bytevector-n port (bytevector-length bv)))))))
(pass-if "put-bytevector [3 args]"
- (with-latin1-locale
+ (with-fluids ((%default-port-encoding "ISO-8859-1"))
(let ((port (make-soft-output-port))
(bv (make-bytevector 256))
(start 10))
@@ -269,7 +268,7 @@
(get-bytevector-n port (- (bytevector-length bv) start)))))))
(pass-if "put-bytevector [4 args]"
- (with-latin1-locale
+ (with-fluids ((%default-port-encoding "ISO-8859-1"))
(let ((port (make-soft-output-port))
(bv (make-bytevector 256))
(start 10)