diff options
author | apnadkarni <apnmbx-wits@yahoo.com> | 2022-07-12 12:31:57 (GMT) |
---|---|---|
committer | apnadkarni <apnmbx-wits@yahoo.com> | 2022-07-12 12:31:57 (GMT) |
commit | 1e6f410bd20b8576dbd0be31a153d56d48a1dae4 (patch) | |
tree | 4d1d271f0b2ebd658230ba2acb4eb32da025102a /tests | |
parent | a6ed76df7c2b1d8c8f3296a99023f88fc76c3f04 (diff) | |
download | tcl-1e6f410bd20b8576dbd0be31a153d56d48a1dae4.zip tcl-1e6f410bd20b8576dbd0be31a153d56d48a1dae4.tar.gz tcl-1e6f410bd20b8576dbd0be31a153d56d48a1dae4.tar.bz2 |
Fix [b79df322a9]. Tcl_GetUnicode/Tcl_NewUnicodeObj crash. Add tests
Diffstat (limited to 'tests')
-rw-r--r-- | tests/string.test | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/string.test b/tests/string.test index d497b42..d128a0b 100644 --- a/tests/string.test +++ b/tests/string.test @@ -34,6 +34,7 @@ testConstraint testindexobj [expr {[info commands testindexobj] ne {}}] testConstraint testevalex [expr {[info commands testevalex] ne {}}] testConstraint utf16 [expr {[string length \U010000] == 2}] testConstraint testbytestring [llength [info commands testbytestring]] +testConstraint testutf16string [llength [info commands testutf16string]] # Used for constraining memory leak tests testConstraint memory [llength [info commands memory]] @@ -2635,6 +2636,17 @@ test string-32.17.$noComp {string is dict, valid dict packed in invalid dict} { } 0 }; # foreach noComp {0 1} + +test string-bug-b79df322a9 {Tcl_GetUnicode/Tcl_NewUnicodeObj api} -constraints { + testutf16string +} -body { + # This simple test suffices because the bug has nothing to do with + # the actual encoding conversion. The test was added because these + # functions are no longer called within the Tcl core and thus + # not tested by either `string`, not `encoding` tests. + testutf16string "abcde" +} -result abcde + # cleanup rename MemStress {} |