diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2008-09-10 13:23:47 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2008-09-10 13:23:47 (GMT) |
commit | b2d9ed24c8428b9c2230515bf13aa76dcfdb607f (patch) | |
tree | 9ae25b29e219c9f6bc5be5c46c47d1f560762124 /tests | |
parent | eb97dfe76d6d46cf1b3c040b8a907305e5300afe (diff) | |
download | tcl-b2d9ed24c8428b9c2230515bf13aa76dcfdb607f.zip tcl-b2d9ed24c8428b9c2230515bf13aa76dcfdb607f.tar.gz tcl-b2d9ed24c8428b9c2230515bf13aa76dcfdb607f.tar.bz2 |
* tests/nre.test: add missing constraints; enable test of foreach
recursion.
* generic/tclBasic.c:
* generic/tclCompile.h:
* generic/tclExecute.c (INST_EVAL_STK): fix for [Bug 2102930],
wrong numLevels when evaling a canonical list.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/nre.test | 49 |
1 files changed, 46 insertions, 3 deletions
diff --git a/tests/nre.test b/tests/nre.test index c415150..ef2802f 100644 --- a/tests/nre.test +++ b/tests/nre.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: nre.test,v 1.5 2008/09/01 12:28:10 msofer Exp $ +# RCS: @(#) $Id: nre.test,v 1.6 2008/09/10 13:24:26 msofer Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -69,6 +69,8 @@ test nre-1.1 {self-recursive procs} -setup { } -cleanup { rename a {} unset abs +} -constraints { + testnrelevels } -result {{0 1 1 1} 0} test nre-1.2 {self-recursive lambdas} -setup { @@ -78,6 +80,8 @@ test nre-1.2 {self-recursive lambdas} -setup { apply $a 0 } -cleanup { unset a abs +} -constraints { + testnrelevels } -result {{0 1 1 1} 0} test nre-1.3 {mutually recursive procs and lambdas} -setup { @@ -91,6 +95,8 @@ test nre-1.3 {mutually recursive procs and lambdas} -setup { } -cleanup { rename a {} unset b abs +} -constraints { + testnrelevels } -result {{0 2 2 2} 0} # @@ -107,6 +113,8 @@ test nre-2.1 {alias is not recursive} -setup { rename a {} rename b {} unset abs +} -constraints { + testnrelevels } -result {{0 2 1 1} 0} # @@ -125,6 +133,8 @@ test nre-3.1 {imports are not recursive} -setup { } -cleanup { rename a {} namespace delete ::foo +} -constraints { + testnrelevels } -result {{0 2 1 1} 0} test nre-4.1 {ensembles are not recursive} -setup { @@ -139,6 +149,8 @@ test nre-4.1 {ensembles are not recursive} -setup { rename a {} rename b {} unset abs +} -constraints { + testnrelevels } -result {{0 2 1 1} 0} test nre-5.1 {[namespace eval] is not recursive} -setup { @@ -150,6 +162,8 @@ test nre-5.1 {[namespace eval] is not recursive} -setup { ::foo::a 0 } -cleanup { namespace delete ::foo +} -constraints { + testnrelevels } -result {{0 2 2 2} 0} test nre-5.2 {[namespace eval] is not recursive} -setup { @@ -161,6 +175,8 @@ test nre-5.2 {[namespace eval] is not recursive} -setup { foo::a 0 } -cleanup { namespace delete ::foo +} -constraints { + testnrelevels } -result {{0 2 2 2} 0} test nre-6.1 {[uplevel] is not recursive} -setup { @@ -171,6 +187,8 @@ test nre-6.1 {[uplevel] is not recursive} -setup { } -cleanup { rename a {} unset abs +} -constraints { + testnrelevels } -result {{0 2 2 0} 0} test nre-6.2 {[uplevel] is not recursive} -setup { @@ -181,6 +199,8 @@ test nre-6.2 {[uplevel] is not recursive} -setup { } -cleanup { rename a {} unset abs +} -constraints { + testnrelevels } -result {{0 2 2 0} 0} test nre-7.1 {[catch] is not recursive} -setup { @@ -191,6 +211,8 @@ test nre-7.1 {[catch] is not recursive} -setup { } -cleanup { rename a {} unset abs +} -constraints { + testnrelevels } -result {{0 3 3 0} 0} test nre-7.2 {[if] is not recursive} -setup { @@ -201,6 +223,8 @@ test nre-7.2 {[if] is not recursive} -setup { } -cleanup { rename a {} unset abs +} -constraints { + testnrelevels } -result {{0 2 2 0} 0} test nre-7.3 {[while] is not recursive} -setup { @@ -211,6 +235,8 @@ test nre-7.3 {[while] is not recursive} -setup { } -cleanup { rename a {} unset abs +} -constraints { + testnrelevels } -result {{0 2 2 0} 0} test nre-7.4 {[for] is not recursive} -setup { @@ -221,6 +247,8 @@ test nre-7.4 {[for] is not recursive} -setup { } -cleanup { rename a {} unset abs +} -constraints { + testnrelevels } -result {{0 2 2 0} 0} test nre-7.5 {[foreach] is not recursive} -constraints {knownBug} -setup { @@ -234,7 +262,9 @@ test nre-7.5 {[foreach] is not recursive} -constraints {knownBug} -setup { } -cleanup { rename a {} unset abs -} -result {{0 2 2 0} 0} +} -constraints { + testnrelevels +} -result {{0 3 3 0} 0} test nre-7.6 {[eval] is not recursive} -setup { proc a i [makebody {eval [list a $i]}] @@ -244,6 +274,8 @@ test nre-7.6 {[eval] is not recursive} -setup { } -cleanup { rename a {} unset abs +} -constraints { + testnrelevels } -result {{0 2 2 1} 0} test nre-7.7 {[eval] is not recursive} -setup { @@ -254,6 +286,8 @@ test nre-7.7 {[eval] is not recursive} -setup { } -cleanup { rename a {} unset abs +} -constraints { + testnrelevels } -result {{0 2 2 1} 0} test nre-8.1 {nre and {*}} -body { @@ -285,6 +319,8 @@ test nre-oo.1 {really deep calls in oo - direct} -setup { } -cleanup { foo destroy unset abs +} -constraints { + testnrelevels } -result {{0 1 1 1} 0} test nre-oo.2 {really deep calls in oo - call via [self]} -setup { @@ -296,6 +332,8 @@ test nre-oo.2 {really deep calls in oo - call via [self]} -setup { } -cleanup { foo destroy unset abs +} -constraints { + testnrelevels } -result {{0 1 1 1} 0} test nre-oo.3 {really deep calls in oo - private calls} -setup { @@ -307,6 +345,8 @@ test nre-oo.3 {really deep calls in oo - private calls} -setup { } -cleanup { foo destroy unset abs +} -constraints { + testnrelevels } -result {{0 1 1 1} 0} test nre-oo.4 {really deep calls in oo - overriding} -setup { @@ -323,6 +363,8 @@ test nre-oo.4 {really deep calls in oo - overriding} -setup { } -cleanup { foo destroy unset abs +} -constraints { + testnrelevels } -result {{0 1 1 1} 0} test nre-oo.5 {really deep calls in oo - forwards} -setup { @@ -338,6 +380,8 @@ test nre-oo.5 {really deep calls in oo - forwards} -setup { } -cleanup { foo destroy unset abs +} -constraints { + testnrelevels } -result {{0 2 1 1} 0} @@ -362,7 +406,6 @@ test nre-X.1 {eval in wrong interp} { set res } {::foo ::foo {} {}} - # cleanup ::tcltest::cleanupTests |