summaryrefslogtreecommitdiffstats
path: root/tests/encoding.test
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-02-23 11:22:22 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-02-23 11:22:22 (GMT)
commite469cdf1901f3bbd96dd0dc2f72cf443a1fe4833 (patch)
tree427fc351f8fc984f078632fb85f33e51ade56cf0 /tests/encoding.test
parentd1920b380d4a987240715b3ce72f7d68dfca2b09 (diff)
parent1d76ffb03b359c7f557943523fd9b0c49a312554 (diff)
downloadtcl-e469cdf1901f3bbd96dd0dc2f72cf443a1fe4833.zip
tcl-e469cdf1901f3bbd96dd0dc2f72cf443a1fe4833.tar.gz
tcl-e469cdf1901f3bbd96dd0dc2f72cf443a1fe4833.tar.bz2
Merge 8.7
Diffstat (limited to 'tests/encoding.test')
-rw-r--r--tests/encoding.test19
1 files changed, 12 insertions, 7 deletions
diff --git a/tests/encoding.test b/tests/encoding.test
index 0abd193..87da880 100644
--- a/tests/encoding.test
+++ b/tests/encoding.test
@@ -534,7 +534,7 @@ 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 {
+test encoding-16.18 {
Utf16ToUtfProc, Tcl_UniCharToUtf, surrogate pairs in utf-16
} -body {
apply [list {} {
@@ -553,10 +553,15 @@ test encoding-16.9 {
return done
} [namespace current]]
} -result done
-
-
-
-
+test encoding-16.19 {UnicodeToUtfProc, bug [d19fe0a5b]} -body {
+ encoding convertfrom utf-16 "\x41\x41\x41"
+} -result \u4141\uFFFD
+test encoding-16.20 {UnicodeToUtfProc, bug [d19fe0a5b]} -constraints deprecated -body {
+ encoding convertfrom utf-16 "\xD8\xD8"
+} -result \uD8D8
+test encoding-16.21 {UnicodeToUtfProc, bug [d19fe0a5b]} -body {
+ encoding convertfrom utf-32 "\x00\x00\x00\x00\x41\x41"
+} -result \x00\uFFFD
test encoding-17.1 {UtfToUtf16Proc} -body {
encoding convertto utf-16 "\U460DC"
@@ -783,10 +788,10 @@ test encoding-24.19 {Parse valid or invalid utf-8} -constraints deprecated -body
} -result ZX\xED\xA0\x80
test encoding-24.20 {Parse with -profile tcl8 but without providing encoding} -body {
encoding convertfrom -profile tcl8 "\x20"
-} -result {wrong # args: should be "::tcl::encoding::convertfrom ??-profile profile? ?-failindex var? ?encoding?? data"} -returnCodes error
+} -result {wrong # args: should be "::tcl::encoding::convertfrom ? ?-profile profile? ?-failindex var? encoding ? data"} -returnCodes error
test encoding-24.21 {Parse with -profile tcl8 but without providing encoding} -body {
string length [encoding convertto -profile tcl8 "\x20"]
-} -result {wrong # args: should be "::tcl::encoding::convertto ??-profile profile? ?-failindex var? ?encoding?? data"} -returnCodes error
+} -result {wrong # args: should be "::tcl::encoding::convertto ? ?-profile profile? ?-failindex var? encoding ? data"} -returnCodes error
test encoding-24.22 {Syntax error, two encodings} -body {
encoding convertfrom iso8859-1 utf-8 "ZX\uD800"
} -result {bad option "iso8859-1": must be -profile or -failindex} -returnCodes error