summaryrefslogtreecommitdiffstats
path: root/tests/compExpr.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/compExpr.test')
-rw-r--r--tests/compExpr.test21
1 files changed, 20 insertions, 1 deletions
diff --git a/tests/compExpr.test b/tests/compExpr.test
index fad8a43..150a63d 100644
--- a/tests/compExpr.test
+++ b/tests/compExpr.test
@@ -8,7 +8,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: compExpr.test,v 1.13.6.2 2007/10/16 03:50:32 dgp Exp $
+# RCS: @(#) $Id: compExpr.test,v 1.13.6.3 2008/01/23 16:42:20 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -342,6 +342,25 @@ test compExpr-7.1 {Memory Leak} -constraints memory -setup {
rename getbytes {}
} -result 0
+test compExpr-7.2 {[Bug 1869989]: expr parser memleak} -constraints memory -setup {
+ proc getbytes {} {
+ set lines [split [memory info] \n]
+ lindex $lines 3 3
+ }
+} -body {
+ set i 5
+ set end [getbytes]
+ while {[incr i -1]} {
+ expr ${i}000
+ set tmp $end
+ set end [getbytes]
+ }
+ set leakedBytes [expr {$end - $tmp}]
+} -cleanup {
+ unset end i tmp
+ rename getbytes {}
+} -result 0
+
# cleanup
catch {unset a}
catch {unset b}