diff options
Diffstat (limited to 'tests/encoding.test')
-rw-r--r-- | tests/encoding.test | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/tests/encoding.test b/tests/encoding.test index 407bd28..1be6fed 100644 --- a/tests/encoding.test +++ b/tests/encoding.test @@ -623,7 +623,7 @@ test encoding-17.12 {Utf32ToUtfProc} -body { test encoding-18.1 {TableToUtfProc on invalid input} -body { list [catch {encoding convertto jis0208 \\} res] $res -} -result {1 {unexpected character at index 0: 'U+00005C'}} +} -result {0 !)} test encoding-18.2 {TableToUtfProc on invalid input with -profile strict} -body { list [catch {encoding convertto -profile strict jis0208 \\} res] $res } -result {1 {unexpected character at index 0: 'U+00005C'}} @@ -810,8 +810,11 @@ test encoding-24.17 {Parse valid or invalid utf-8} -constraints testbytestring - test encoding-24.18 {Parse valid or invalid utf-8} -constraints testbytestring -body { encoding convertto utf-8 [testbytestring "Z\xE0\x80xxxxxx"] } -result "Z\xC3\xA0\xE2\x82\xACxxxxxx" -test encoding-24.19 {Parse valid or invalid utf-8} -body { - encoding convertto utf-8 "ZX\uD800" +test encoding-24.19.1 {Parse valid or invalid utf-8} -body { + encoding convertto -profile tcl8 utf-8 "ZX\uD800" +} -result ZX\xED\xA0\x80 +test encoding-24.19.2 {Parse valid or invalid utf-8} -body { + encoding convertto -profile strict utf-8 "ZX\uD800" } -returnCodes 1 -match glob -result "unexpected character at index 2: 'U+00D800'" test encoding-24.20 {Parse with -profile tcl8 but without providing encoding} -body { encoding convertfrom -profile tcl8 "\x20" @@ -867,9 +870,12 @@ test encoding-24.36 {Parse invalid utf-8 with -profile strict} -body { test encoding-24.37 {Parse invalid utf-8 with -profile tcl8} -body { encoding convertfrom -profile tcl8 utf-8 \xED\xA0\x80 } -result \uD800 -test encoding-24.38 {Try to generate invalid utf-8} -body { - encoding convertto utf-8 \uD800 +test encoding-24.38.1 {Try to generate invalid utf-8} -body { + encoding convertto -profile tcl8 utf-8 \uD800 } -returnCodes 1 -result {unexpected character at index 0: 'U+00D800'} +test encoding-24.38.2 {Try to generate invalid utf-8} -body { + encoding convertto -profile strict utf-8 \uD800 +} -result \xED\xA0\x80 test encoding-24.39 {Try to generate invalid utf-8 with -profile strict} -body { encoding convertto -profile strict utf-8 \uD800 } -returnCodes 1 -result {unexpected character at index 0: 'U+00D800'} |