diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2013-06-05 07:51:06 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2013-06-05 07:51:06 (GMT) |
commit | 4d139bcdd3359f4e4d35db3d5fce67c6b528532c (patch) | |
tree | 9f3d3a4d45751c03ed62df1c0c5cdfac15c0f52c /tests/for.test | |
parent | e2aebdd0bfef45036c0e1242c55efd86773ecca4 (diff) | |
download | tcl-4d139bcdd3359f4e4d35db3d5fce67c6b528532c.zip tcl-4d139bcdd3359f4e4d35db3d5fce67c6b528532c.tar.gz tcl-4d139bcdd3359f4e4d35db3d5fce67c6b528532c.tar.bz2 |
Even better tests
Diffstat (limited to 'tests/for.test')
-rw-r--r-- | tests/for.test | 34 |
1 files changed, 32 insertions, 2 deletions
diff --git a/tests/for.test b/tests/for.test index c5803ee..8936682 100644 --- a/tests/for.test +++ b/tests/for.test @@ -882,7 +882,7 @@ test for-7.4 {Bug 3614226: ensure that continue cleans up the expansion stack} m expr {$end - $tmp} }} } 0 -test for-7.5 {Bug 3614226: ensure that break cleans up the expansion stack} memory { +test for-7.5 {Bug 3614226: ensure that break cleans up the combination of main and expansion stack} memory { apply {{} { set l [lrepeat 50 p q r] # Can't use [memtest]; must be careful when we change stack frames @@ -897,7 +897,7 @@ test for-7.5 {Bug 3614226: ensure that break cleans up the expansion stack} memo expr {$end - $tmp} }} } 0 -test for-7.6 {Bug 3614226: ensure that continue cleans up the expansion stack} memory { +test for-7.6 {Bug 3614226: ensure that continue cleans up the combination of main and expansion stack} memory { apply {{} { set l [lrepeat 50 p q r] # Can't use [memtest]; must be careful when we change stack frames @@ -912,6 +912,36 @@ test for-7.6 {Bug 3614226: ensure that continue cleans up the expansion stack} m expr {$end - $tmp} }} } 0 +test for-7.7 {Bug 3614226: ensure that break only cleans up the right amount} memory { + apply {{} { + set l [lrepeat 50 p q r] + # Can't use [memtest]; must be careful when we change stack frames + set end [meminfo] + for {set i 0} {$i < 5} {incr i} { + unset -nocomplain {*}[for {set x 0} {[incr x]<50} {} { + puts [puts {*}$l {*}[puts a b c {*}$l {*}[break] d e f]] + }] + set tmp $end + set end [meminfo] + } + expr {$end - $tmp} + }} +} 0 +test for-7.8 {Bug 3614226: ensure that continue only cleans up the right amount} memory { + apply {{} { + set l [lrepeat 50 p q r] + # Can't use [memtest]; must be careful when we change stack frames + set end [meminfo] + for {set i 0} {$i < 5} {incr i} { + unset -nocomplain {*}[for {set x 0} {[incr x]<50} {} { + puts [puts {*}$l {*}[puts a b c {*}$l {*}[continue] d e f]] + }] + set tmp $end + set end [meminfo] + } + expr {$end - $tmp} + }} +} 0 # cleanup ::tcltest::cleanupTests |