summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorpooryorick <com.digitalsmarties@pooryorick.com>2023-01-25 02:52:24 (GMT)
committerpooryorick <com.digitalsmarties@pooryorick.com>2023-01-25 02:52:24 (GMT)
commitca4e244cca3e93fb8689fe1cef85954da16ff989 (patch)
treec2321e196bba19f06f9a2cd1fd815c24210acc78 /tests
parentc18f5f7f8caa27fa6dc03bd79a4136391cad620f (diff)
downloadtcl-ca4e244cca3e93fb8689fe1cef85954da16ff989.zip
tcl-ca4e244cca3e93fb8689fe1cef85954da16ff989.tar.gz
tcl-ca4e244cca3e93fb8689fe1cef85954da16ff989.tar.bz2
Test TableFromUtfProc() with strict handling of encoding errors.
Diffstat (limited to 'tests')
-rw-r--r--tests/encoding.test8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/encoding.test b/tests/encoding.test
index a1d129e..d9382e4 100644
--- a/tests/encoding.test
+++ b/tests/encoding.test
@@ -513,8 +513,11 @@ test encoding-17.10 {Utf32ToUtfProc} -body {
encoding convertfrom -nocomplain utf-32 "\xFF\xFF\xFF\xFF"
} -result \uFFFD
-test encoding-18.1 {TableToUtfProc} {
-} {}
+
+test encoding-18.1 {TableToUtfProc error on invalid input with -strict} -body {
+ list [catch {encoding convertto -strict jis0208 \\} res] $res
+} -result {1 {unexpected character at index 0: 'U+00005C'}}
+
test encoding-19.1 {TableFromUtfProc} {
} {}
@@ -915,6 +918,7 @@ test encoding-29.0 {get encoding nul terminator lengths} -constraints {
[testencoding nullength ksc5601]
} -result {1 2 4 2 2}
+
# cleanup
namespace delete ::tcl::test::encoding
::tcltest::cleanupTests