summaryrefslogtreecommitdiffstats
path: root/tests/format.test
diff options
context:
space:
mode:
authorsebres <sebres@users.sourceforge.net>2018-07-26 18:58:03 (GMT)
committersebres <sebres@users.sourceforge.net>2018-07-26 18:58:03 (GMT)
commitad757b50dce2f04dd5e6d034a96f4ddd90621a0e (patch)
treecfbfa288827264191f775831eb764124204cccde /tests/format.test
parent304b56917085547380c76f70b6adcb5a92e5cba6 (diff)
parent590288982511400f0dd0f244fb753b01a8bae140 (diff)
downloadtcl-ad757b50dce2f04dd5e6d034a96f4ddd90621a0e.zip
tcl-ad757b50dce2f04dd5e6d034a96f4ddd90621a0e.tar.gz
tcl-ad757b50dce2f04dd5e6d034a96f4ddd90621a0e.tar.bz2
merge 8.6: bug [d051b77fc1] fixed
Diffstat (limited to 'tests/format.test')
-rw-r--r--tests/format.test14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/format.test b/tests/format.test
index ed8676a..cdea545 100644
--- a/tests/format.test
+++ b/tests/format.test
@@ -597,6 +597,20 @@ test format-19.3 {Bug 2830354} {
string length [format %340f 0]
} 340
+test format-19.4.1 {Bug d498578df4: width overflow should cause limit exceeded} \
+-constraints {longIs32bit} -body {
+ # in case of overflow into negative, it produces width -2 (and limit exceeded),
+ # in case of width will be unsigned, it will be outside limit (2GB for 32bit)...
+ # and it don't throw an error in case the bug is not fixed (and probably no segfault).
+ format %[expr {0xffffffff - 1}]g 0
+} -returnCodes error -result "max size for a Tcl value exceeded"
+
+test format-19.4.2 {Bug d498578df4: width overflow should cause limit exceeded} -body {
+ # limit should exceeds in any case,
+ # and it don't throw an error in case the bug is not fixed (and probably no segfault).
+ format %[expr {0xffffffffffffffff - 1}]g 0
+} -returnCodes error -result "max size for a Tcl value exceeded"
+
# Note that this test may fail in future versions
test format-20.1 {Bug 2932421: plain %s caused intrep change of args} -body {
set x [dict create a b c d]