summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorapnadkarni <apnmbx-wits@yahoo.com>2023-02-28 10:28:28 (GMT)
committerapnadkarni <apnmbx-wits@yahoo.com>2023-02-28 10:28:28 (GMT)
commit8e139e5cd76b6d1499b660d7ecd2d61adb5d0c85 (patch)
tree6accc22bc262564995f1cd41135aa5b3b54aa18c /tests
parent57d266423a5638cbedc01dc406d5af47a146ca20 (diff)
parent85bf0db1e84ab483fce7962c151bedeb3f5e0993 (diff)
downloadtcl-8e139e5cd76b6d1499b660d7ecd2d61adb5d0c85.zip
tcl-8e139e5cd76b6d1499b660d7ecd2d61adb5d0c85.tar.gz
tcl-8e139e5cd76b6d1499b660d7ecd2d61adb5d0c85.tar.bz2
Merge bug-fb368527ae. Bug [fb368527ae] Large string truncation
Diffstat (limited to 'tests')
-rw-r--r--tests/encoding.test26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/encoding.test b/tests/encoding.test
index e0e1598..8b14353 100644
--- a/tests/encoding.test
+++ b/tests/encoding.test
@@ -1046,6 +1046,32 @@ test encoding-29.0 {get encoding nul terminator lengths} -constraints {
[testencoding nullength ksc5601]
} -result {1 2 4 2 2}
+test encoding-30.0 {encoding convertto large strings UINT_MAX} -constraints {
+ perf
+} -body {
+ # Test to ensure not misinterpreted as -1
+ list [string length [set s [string repeat A 0xFFFFFFFF]]] [string equal $s [encoding convertto ascii $s]]
+} -result {4294967295 1}
+
+test encoding-30.1 {encoding convertto large strings > 4GB} -constraints {
+ perf
+} -body {
+ list [string length [set s [string repeat A 0x100000000]]] [string equal $s [encoding convertto ascii $s]]
+} -result {4294967296 1}
+
+test encoding-30.2 {encoding convertfrom large strings UINT_MAX} -constraints {
+ perf
+} -body {
+ # Test to ensure not misinterpreted as -1
+ list [string length [set s [string repeat A 0xFFFFFFFF]]] [string equal $s [encoding convertfrom ascii $s]]
+} -result {4294967295 1}
+
+test encoding-30.3 {encoding convertfrom large strings > 4GB} -constraints {
+ perf
+} -body {
+ list [string length [set s [string repeat A 0x100000000]]] [string equal $s [encoding convertfrom ascii $s]]
+} -result {4294967296 1}
+
# cleanup
namespace delete ::tcl::test::encoding