summaryrefslogtreecommitdiffstats
path: root/tests/encoding.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-03-30 13:35:15 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-03-30 13:35:15 (GMT)
commit78a0992b4431f976641f3d08f63c13fab742e1b9 (patch)
treedfc0285585e08653ecb2e634f267fba7443a48cf /tests/encoding.test
parent41533dc84a21444a1885476d2b4ac780b6581a44 (diff)
downloadtcl-78a0992b4431f976641f3d08f63c13fab742e1b9.zip
tcl-78a0992b4431f976641f3d08f63c13fab742e1b9.tar.gz
tcl-78a0992b4431f976641f3d08f63c13fab742e1b9.tar.bz2
Better error-messages
Diffstat (limited to 'tests/encoding.test')
-rw-r--r--tests/encoding.test11
1 files changed, 7 insertions, 4 deletions
diff --git a/tests/encoding.test b/tests/encoding.test
index 1c12be0..114b296 100644
--- a/tests/encoding.test
+++ b/tests/encoding.test
@@ -585,19 +585,22 @@ test encoding-24.12 {Parse valid or invalid utf-8} {
} 1
test encoding-24.13 {Parse valid or invalid utf-8} -body {
encoding convertfrom utf-8 "\xC0\x81" -stoponerror
-} -returnCodes 1 -result {decoding error after reading 0 bytes}
+} -returnCodes 1 -result {unexpected byte at index 0: 'À' (\xC0)}
test encoding-24.14 {Parse valid or invalid utf-8} -body {
encoding convertfrom utf-8 "\xC1\xBF" -stoponerror
-} -returnCodes 1 -result {decoding error after reading 0 bytes}
+} -returnCodes 1 -result {unexpected byte at index 0: 'Á' (\xC1)}
test encoding-24.15 {Parse valid or invalid utf-8} {
string length [encoding convertfrom utf-8 "\xC2\x80" -stoponerror]
} 1
test encoding-24.16 {Parse valid or invalid utf-8} -body {
encoding convertfrom utf-8 "Z\xE0\x80" -stoponerror
-} -returnCodes 1 -result {decoding error after reading 1 byte}
+} -returnCodes 1 -result {unexpected byte at index 1: 'à' (\xE0)}
test encoding-24.17 {Parse valid or invalid utf-8} -constraints testbytestring -body {
+ encoding convertto utf-8 [testbytestring "Z\u4343\x80"] -stoponerror
+} -returnCodes 1 -result {expected byte sequence but character 1 was '䍃€' (U+004343)}
+test encoding-24.18 {Parse valid or invalid utf-8} -constraints testbytestring -body {
encoding convertto utf-8 [testbytestring "Z\xE0\x80"] -stoponerror
-} -returnCodes 1 -result {encoding error after reading 1 character}
+} -returnCodes 1 -match glob -result {unexpected character at index 1: '*' (U+0000E0)}
file delete [file join [temporaryDirectory] iso2022.txt]