diff options
author | Miguel Sofer <miguel.sofer@gmail.com> | 2006-11-03 23:24:43 (GMT) |
---|---|---|
committer | Miguel Sofer <miguel.sofer@gmail.com> | 2006-11-03 23:24:43 (GMT) |
commit | 582529b442db759535075226bac5cb74b4b5c783 (patch) | |
tree | b21863c4864afd6ce4e8ff900e3c7a8d28946a0a /tests/trace.test | |
parent | 2afbba78fdfe1f2fb3310a5b778aac9ee5c5843c (diff) | |
download | tcl-582529b442db759535075226bac5cb74b4b5c783.zip tcl-582529b442db759535075226bac5cb74b4b5c783.tar.gz tcl-582529b442db759535075226bac5cb74b4b5c783.tar.bz2 |
* generic/tclBasic.c (TEOVI):
* tests/trace.test (trace-21.11): fix for [Bug 1590232], execution
traces may cause a second command resolution in the wrong
namespace.
Diffstat (limited to 'tests/trace.test')
-rw-r--r-- | tests/trace.test | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/trace.test b/tests/trace.test index 7c74c0c..5ab6a72 100644 --- a/tests/trace.test +++ b/tests/trace.test @@ -11,7 +11,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: trace.test,v 1.50 2006/11/03 00:34:53 hobbs Exp $ +# RCS: @(#) $Id: trace.test,v 1.51 2006/11/03 23:24:43 msofer Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -1610,7 +1610,7 @@ test trace-21.9 {trace execution: TCL_EVAL_GLOBAL} testevalobjv { trace remove execution foo enter soom set ::info } {SUCCESS 1 SUCCESS 1} - + test trace-21.10 {trace execution: TCL_EVAL_GLOBAL} testevalobjv { trace add execution foo leave soom proc ::soom args {lappend ::info SUCCESS [info level]} @@ -1627,6 +1627,24 @@ test trace-21.10 {trace execution: TCL_EVAL_GLOBAL} testevalobjv { set ::info } {SUCCESS 1 SUCCESS 1} +test trace-21.11 {trace execution and alias} -setup { + set res {} + proc ::x {} {return ::} + namespace eval a {} + proc ::a::x {} {return ::a} + interp alias {} y {} x +} -body { + lappend res [namespace eval ::a y] + trace add execution ::x enter { + rename ::x {} + proc ::x {} {return ::} + #} + lappend res [namespace eval ::a y] +} -cleanup { + namespace delete a + rename ::x {} +} -result {:: ::} + proc factorial {n} { if {$n != 1} { return [expr {$n * [factorial [expr {$n -1 }]]}] } return 1 |