summaryrefslogtreecommitdiffstats
path: root/tests/encoding.test
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-02-17 11:08:17 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-02-17 11:08:17 (GMT)
commit359092510ba2f6649ffd600325e4be44bc1d866c (patch)
treece26d61aa708ab5bd9eb5d82d55397df74ac1b68 /tests/encoding.test
parent684cbb8f5cc3ed03b9349b0d322b04f1c87cc86a (diff)
parent2c3252bc5c0a80e90ade82389f8b80faa41a6e77 (diff)
downloadtcl-359092510ba2f6649ffd600325e4be44bc1d866c.zip
tcl-359092510ba2f6649ffd600325e4be44bc1d866c.tar.gz
tcl-359092510ba2f6649ffd600325e4be44bc1d866c.tar.bz2
Merge 8.7
Diffstat (limited to 'tests/encoding.test')
-rw-r--r--tests/encoding.test21
1 files changed, 15 insertions, 6 deletions
diff --git a/tests/encoding.test b/tests/encoding.test
index 7b3304b..de6b87b 100644
--- a/tests/encoding.test
+++ b/tests/encoding.test
@@ -459,17 +459,20 @@ test encoding-15.26 {UtfToUtfProc CESU-8} {
encoding convertfrom cesu-8 \xC0\x80
} \x00
test encoding-15.27 {UtfToUtfProc -profile strict CESU-8} {
- encoding convertfrom -profile strict cesu-8 \xC0\x80
+ encoding convertfrom -profile strict cesu-8 \x00
} \x00
-test encoding-15.28 {UtfToUtfProc -profile strict CESU-8} {
+test encoding-15.28 {UtfToUtfProc -profile strict CESU-8} -body {
encoding convertfrom -profile strict cesu-8 \xC0\x80
-} \x00
+} -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xC0'}
test encoding-15.29 {UtfToUtfProc CESU-8} {
encoding convertto cesu-8 \x00
-} \xC0\x80
+} \x00
test encoding-15.30 {UtfToUtfProc -profile strict CESU-8} {
encoding convertto -profile strict cesu-8 \x00
-} \xC0\x80
+} \x00
+test encoding-15.31 {UtfToUtfProc -profile strict CESU-8 (bytes F0-F4 are invalid)} -body {
+ encoding convertfrom -profile strict cesu-8 \xF1\x86\x83\x9C
+} -returnCodes 1 -result {unexpected byte sequence starting at index 0: '\xF1'}
test encoding-16.1 {Utf16ToUtfProc} -body {
set val [encoding convertfrom utf-16 NN]
@@ -527,6 +530,9 @@ test encoding-16.15 {Utf16ToUtfProc} -body {
test encoding-16.16 {Utf16ToUtfProc} -body {
encoding convertfrom utf-16le \x00\xDC\x00\xD8
} -result \uDC00\uD800
+test encoding-16.17 {Utf32ToUtfProc} -body {
+ list [encoding convertfrom -profile strict -failindex idx utf-32le \x41\x00\x00\x00\x00\xD8\x00\x00\x42\x00\x00\x00] [set idx]
+} -result {A 4}
test encoding-16.9 {
Utf16ToUtfProc, Tcl_UniCharToUtf, surrogate pairs in utf-16
@@ -614,9 +620,12 @@ test encoding-19.3 {TableFromUtfProc} -body {
test encoding-19.4 {TableFromUtfProc} -body {
list [encoding convertfrom -failindex idx ascii AÁ] [set idx]
} -result [list A\xC1 -1]
-test encoding-19.4 {TableFromUtfProc} -body {
+test encoding-19.5 {TableFromUtfProc} -body {
list [encoding convertfrom -failindex idx -profile strict ascii A\xC1] [set idx]
} -result {A 1}
+test encoding-19.6 {TableFromUtfProc} -body {
+ list [encoding convertfrom -failindex idx -profile strict ascii AÁB] [set idx]
+} -result {A 1}
test encoding-20.1 {TableFreefProc} {
} {}