summaryrefslogtreecommitdiffstats
path: root/tests/encoding.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2023-02-16 16:59:10 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2023-02-16 16:59:10 (GMT)
commit0563a789022a80cd7745d596028b570f0fb24cbb (patch)
treeffe4b5ae51aee03f387b10cd8ab6b6edbd6e3421 /tests/encoding.test
parent4c2d834fca441a8d463e3bd1a06489f0b864cf73 (diff)
downloadtcl-0563a789022a80cd7745d596028b570f0fb24cbb.zip
tcl-0563a789022a80cd7745d596028b570f0fb24cbb.tar.gz
tcl-0563a789022a80cd7745d596028b570f0fb24cbb.tar.bz2
Fix [5e6ae6e05e]: Implement -strict correctly for cesu-8
Diffstat (limited to 'tests/encoding.test')
-rw-r--r--tests/encoding.test13
1 files changed, 8 insertions, 5 deletions
diff --git a/tests/encoding.test b/tests/encoding.test
index 916a84a..34dfafb 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 -strict CESU-8} {
- encoding convertfrom -strict cesu-8 \xC0\x80
+ encoding convertfrom -strict cesu-8 \x00
} \x00
-test encoding-15.28 {UtfToUtfProc -strict CESU-8} {
+test encoding-15.28 {UtfToUtfProc -strict CESU-8} -body {
encoding convertfrom -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 -strict CESU-8} {
encoding convertto -strict cesu-8 \x00
-} \xC0\x80
+} \x00
+test encoding-15.31 {UtfToUtfProc -strict CESU-8 (bytes F0-F4 are invalid)} -body {
+ encoding convertfrom -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]