diff options
author | dgp <dgp@users.sourceforge.net> | 2006-02-28 15:47:10 (GMT) |
---|---|---|
committer | dgp <dgp@users.sourceforge.net> | 2006-02-28 15:47:10 (GMT) |
commit | ee4fdde97a86a54e979eba422b462f0c45ae9121 (patch) | |
tree | 60936ebfe7abee67de474ed25fe62f127d92aee8 /tests/parse.test | |
parent | 79c06cebc59a8bb6423c763367e84015e5fb0322 (diff) | |
download | tcl-ee4fdde97a86a54e979eba422b462f0c45ae9121.zip tcl-ee4fdde97a86a54e979eba422b462f0c45ae9121.tar.gz tcl-ee4fdde97a86a54e979eba422b462f0c45ae9121.tar.bz2 |
* generic/tclBasic.c: Corrections to be sure that TCL_EVAL_GLOBAL
* tests/namespace.test: evaluations act the same as [uplevel #0]
* tests/parse.test: evaluations, even when execution traces or
* tests/trace.test: invocations of [::unknown] are present.
[Bug 1439836].
Diffstat (limited to 'tests/parse.test')
-rw-r--r-- | tests/parse.test | 36 |
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/parse.test b/tests/parse.test index 8481a6f..fa1f344 100644 --- a/tests/parse.test +++ b/tests/parse.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: parse.test,v 1.21 2005/05/10 18:35:22 kennykb Exp $ +# RCS: @(#) $Id: parse.test,v 1.22 2006/02/28 15:47:10 dgp Exp $ if {[catch {package require tcltest 2.0.2}]} { puts stderr "Skipping tests in [info script]. tcltest 2.0.2 required." @@ -365,6 +365,40 @@ test parse-8.8 {Tcl_EvalObjv procedure, async handlers} -constraints { test parse-8.9 {Tcl_EvalObjv procedure, exceptional return} testevalobjv { list [catch {testevalobjv 0 error message} msg] $msg } {1 message} +test parse-8.10 {Tcl_EvalObjv procedure, TCL_EVAL_GLOBAL} testevalobjv { + rename ::unknown unknown.save + proc ::unknown args {lappend ::info [info level]} + catch {rename ::noSuchCommand {}} + set ::info {} + namespace eval test_ns_1 { + testevalobjv 1 noSuchCommand + uplevel #0 noSuchCommand + } + namespace delete test_ns_1 + rename ::unknown {} + rename unknown.save ::unknown + set ::info +} {1 1} +test parse-8.11 {Tcl_EvalObjv procedure, TCL_EVAL_INVOKE} testevalobjv { + rename ::unknown unknown.save + proc ::unknown args {lappend ::info [info level]; uplevel 1 foo} + proc ::foo args {lappend ::info global} + catch {rename ::noSuchCommand {}} + set ::slave [interp create] + $::slave alias bar noSuchCommand + set ::info {} + namespace eval test_ns_1 { + proc foo args {lappend ::info namespace} + $::slave eval bar + testevalobjv 1 [list $::slave eval bar] + uplevel #0 [list $::slave eval bar] + } + namespace delete test_ns_1 + rename ::foo {} + rename ::unknown {} + rename unknown.save ::unknown + set ::info +} [subst {[set level 2; incr level [info level]] namespace 1 global 1 global}] test parse-9.1 {Tcl_LogCommandInfo, line numbers} testevalex { catch {unset x} |