diff options
author | dkf <dkf@noemail.net> | 2004-06-23 00:24:30 (GMT) |
---|---|---|
committer | dkf <dkf@noemail.net> | 2004-06-23 00:24:30 (GMT) |
commit | cf65137893b3a88b8328456a0c36c2ae431f26fe (patch) | |
tree | 5a154848a1901797f909f029933e19ccdb283c63 /tests/stack.test | |
parent | 771f270005d894fd17259f8dd7fd5c94307b666d (diff) | |
download | tcl-cf65137893b3a88b8328456a0c36c2ae431f26fe.zip tcl-cf65137893b3a88b8328456a0c36c2ae431f26fe.tar.gz tcl-cf65137893b3a88b8328456a0c36c2ae431f26fe.tar.bz2 |
Version of [Patch 746578] that works with Linux and is likely to work elsewhere
FossilOrigin-Name: f7e8a168836aa49464f2bac4a69dbde6ac8a8eb9
Diffstat (limited to 'tests/stack.test')
-rw-r--r-- | tests/stack.test | 44 |
1 files changed, 20 insertions, 24 deletions
diff --git a/tests/stack.test b/tests/stack.test index 362133b..64b669a 100644 --- a/tests/stack.test +++ b/tests/stack.test @@ -9,7 +9,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: stack.test,v 1.17 2004/06/22 19:41:25 kennykb Exp $ +# RCS: @(#) $Id: stack.test,v 1.18 2004/06/23 00:24:43 dkf Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest 2 @@ -56,30 +56,26 @@ test stack-2.1 {maxNestingDepth reached on infinite recursion} {minStack2400} { } {too many nested evaluations (infinite loop?)} # Make sure that there is enough stack to run regexp even if we're -# close to the recursion limit. [Bug 947070] - -test stack-3.1 {enough room for regexp near recursion limit} \ - -constraints { win } \ - -setup { - set ::limit [interp recursionlimit {} 10000] - proc a { max } { - if { [info level] < $max } { - set ::depth [info level] - a $max - } else { - regexp {^ ?} x - } +# close to the recursion limit. [Bug 947070] [Patch 746378] +test stack-3.1 {enough room for regexp near recursion limit} -setup { + set limit [interp recursionlimit {} 10000] + set depth 0 + proc a { max } { + if { [info level] < $max } { + set ::depth [info level] + a $max + } else { + regexp {^ ?} x } - } -body { - set ::depth 0 - catch { a 10001 } - set depth2 $depth - catch { a $::depth } - expr { $depth2 - $depth } - } -cleanup { - interp recursionlimit {} $::limit - rename a {} - } -result {1} + } +} -body { + catch { a 10001 } + set depth2 $depth + list [a $depth] [expr { $depth2 - $depth }] +} -cleanup { + interp recursionlimit {} $limit + rename a {} +} -result {1 1} # cleanup ::tcltest::cleanupTests |