[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] 04/07: Avoid 'with-latin1-locale' in binary I/O tests.
From: |
Mark H. Weaver |
Subject: |
[Guile-commits] 04/07: Avoid 'with-latin1-locale' in binary I/O tests. |
Date: |
Tue, 7 May 2019 04:46:50 -0400 (EDT) |
mhw pushed a commit to branch stable-2.2
in repository guile.
commit 162a031e5f2c64cd23fcf069fb7b5071196f9527
Author: Mark H Weaver <address@hidden>
Date: Fri Apr 19 03:09:37 2019 -0400
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.
---
test-suite/tests/r6rs-ports.test | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
diff --git a/test-suite/tests/r6rs-ports.test b/test-suite/tests/r6rs-ports.test
index e6ee10a..5b46ccc 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)
- [Guile-commits] branch stable-2.2 updated (6381845 -> 7c2b48a), Mark H. Weaver, 2019/05/07
- [Guile-commits] 02/07: Fix typo in comment., Mark H. Weaver, 2019/05/07
- [Guile-commits] 05/07: Optimize fixnum exact integer square roots., Mark H. Weaver, 2019/05/07
- [Guile-commits] 03/07: Fix indentation in scm_sum., Mark H. Weaver, 2019/05/07
- [Guile-commits] 04/07: Avoid 'with-latin1-locale' in binary I/O tests.,
Mark H. Weaver <=
- [Guile-commits] 07/07: Strings, i18n: Limit the use of alloca to approximately 8 kilobytes., Mark H. Weaver, 2019/05/07
- [Guile-commits] 06/07: put-u8: Always write a single byte, regardless of the port encoding., Mark H. Weaver, 2019/05/07
- [Guile-commits] 01/07: Add 'scm_c_make_char' and use it where appropriate., Mark H. Weaver, 2019/05/07