summaryrefslogtreecommitdiffstats
path: root/tests/encoding.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-12 12:37:29 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-03-12 12:37:29 (GMT)
commit77e951f2b86cf0b20c2b38c753726d149a1c4ea9 (patch)
tree62f596a906461e4a52c2fc37bce67bef0217e922 /tests/encoding.test
parent8bf2e2ace2224e4066dfe647f47b531591fe8666 (diff)
parent1889ded1144a4dbd44d0c6f03e72a01d70115a51 (diff)
downloadtcl-77e951f2b86cf0b20c2b38c753726d149a1c4ea9.zip
tcl-77e951f2b86cf0b20c2b38c753726d149a1c4ea9.tar.gz
tcl-77e951f2b86cf0b20c2b38c753726d149a1c4ea9.tar.bz2
Fix [db7a085bd9]: encoding convertfrom -strict utf-16 accepts partial surrogates
Diffstat (limited to 'tests/encoding.test')
-rw-r--r--tests/encoding.test12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/encoding.test b/tests/encoding.test
index 81323f4..0fe64ce 100644
--- a/tests/encoding.test
+++ b/tests/encoding.test
@@ -553,15 +553,21 @@ test encoding-16.18 {
return done
} [namespace current]]
} -result done
-test encoding-16.19 {UnicodeToUtfProc, bug [d19fe0a5b]} -body {
+test encoding-16.19 {Utf16ToUtfProc, bug [d19fe0a5b]} -body {
encoding convertfrom utf-16 "\x41\x41\x41"
} -result \u4141\uFFFD
-test encoding-16.20 {UnicodeToUtfProc, bug [d19fe0a5b]} -constraints deprecated -body {
+test encoding-16.20 {Utf16ToUtfProc, bug [d19fe0a5b]} -constraints deprecated -body {
encoding convertfrom utf-16 "\xD8\xD8"
} -result \uD8D8
-test encoding-16.21 {UnicodeToUtfProc, bug [d19fe0a5b]} -body {
+test encoding-16.21 {Utf16ToUtfProc, bug [d19fe0a5b]} -body {
encoding convertfrom utf-32 "\x00\x00\x00\x00\x41\x41"
} -result \x00\uFFFD
+test encoding-16.22 {Utf16ToUtfProc, strict, bug [db7a085bd9]} -body {
+ encoding convertfrom -strict utf-16le \x00\xD8
+} -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\x00'}
+test encoding-16.23 {Utf16ToUtfProc, strict, bug [db7a085bd9]} -body {
+ encoding convertfrom -strict utf-16le \x00\xDC
+} -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\x00'}
test encoding-17.1 {UtfToUtf16Proc} -body {
encoding convertto utf-16 "\U460DC"