summaryrefslogtreecommitdiff
path: root/test-suite/tests/ports.test
diff options
context:
space:
mode:
authorChristopher Baines <mail@cbaines.net>2023-03-20 09:15:13 +0000
committerLudovic Courtès <ludo@gnu.org>2023-03-20 23:23:29 +0100
commitcba2e7e3fec3c781230570f5d1ef070625eeeda8 (patch)
treecad0acad118be78cc159381c8b14868550246abc /test-suite/tests/ports.test
parentffb95239aacf86d8dc622a438bdaacfac4a66efc (diff)
downloadguile-cba2e7e3fec3c781230570f5d1ef070625eeeda8.tar.gz
Fix some invalid unicode handling issues with suspendable ports.
Fixes <https://bugs.gnu.org/62290>. Based on the implementation in ports.c. I don't understand what this code is really doing, but the suspendable ports implementation differs from the similar C code for a couple of inequalities. * module/ice-9/suspendable-ports.scm (decode-utf8, bad-utf8-len): Flip a couple of inequalities. * test-suite/tests/ports.test ("string ports"): Add additional invalid UTF-8 test case. * NEWS: Update. Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'test-suite/tests/ports.test')
-rw-r--r--test-suite/tests/ports.test7
1 files changed, 7 insertions, 0 deletions
diff --git a/test-suite/tests/ports.test b/test-suite/tests/ports.test
index 66e10e3dd..1b30e1a68 100644
--- a/test-suite/tests/ports.test
+++ b/test-suite/tests/ports.test
@@ -1063,6 +1063,13 @@
error ;; 88: not a valid starting byte
error ;; 88: not a valid starting byte
error ;; 88: not a valid starting byte
+ eof))
+
+ (test-decoding-error (#xf4 #xa4 #xbd #xa4) "UTF-8"
+ (error ;; 2nd byte should be in the 90..BF range
+ error ;; 88: not a valid starting byte
+ error ;; 88: not a valid starting byte
+ error ;; 88: not a valid starting byte
eof))))
(with-test-prefix "call-with-output-string"