summaryrefslogtreecommitdiffstats
path: root/tests/trace.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2006-02-28 15:47:10 (GMT)
committerdgp <dgp@users.sourceforge.net>2006-02-28 15:47:10 (GMT)
commitee4fdde97a86a54e979eba422b462f0c45ae9121 (patch)
tree60936ebfe7abee67de474ed25fe62f127d92aee8 /tests/trace.test
parent79c06cebc59a8bb6423c763367e84015e5fb0322 (diff)
downloadtcl-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/trace.test')
-rw-r--r--tests/trace.test35
1 files changed, 34 insertions, 1 deletions
diff --git a/tests/trace.test b/tests/trace.test
index 7766431..657c86a 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.47 2005/11/18 23:42:12 msofer Exp $
+# RCS: @(#) $Id: trace.test,v 1.48 2006/02/28 15:47:10 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -19,6 +19,7 @@ if {[lsearch [namespace children] ::tcltest] == -1} {
}
testConstraint testcmdtrace [llength [info commands testcmdtrace]]
+testConstraint testevalobjv [llength [info commands testevalobjv]]
# Used for constraining memory leak tests
testConstraint memory [llength [info commands memory]]
@@ -1594,6 +1595,38 @@ test trace-21.8 {trace execution: leavestep} {
set info
} {{foo {set b 3} 0 3 leavestep}}
+test trace-21.9 {trace execution: TCL_EVAL_GLOBAL} testevalobjv {
+ trace add execution foo enter soom
+ proc ::soom args {lappend ::info SUCCESS [info level]}
+ set ::info {}
+ namespace eval test_ns_1 {
+ proc soom args {lappend ::info FAIL [info level]}
+ # [testevalobjv 1 ...] ought to produce the same
+ # results as [uplevel #0 ...].
+ testevalobjv 1 foo x
+ uplevel #0 foo x
+ }
+ namespace delete test_ns_1
+ 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]}
+ set ::info {}
+ namespace eval test_ns_1 {
+ proc soom args {lappend ::info FAIL [info level]}
+ # [testevalobjv 1 ...] ought to produce the same
+ # results as [uplevel #0 ...].
+ testevalobjv 1 foo x
+ uplevel #0 foo x
+ }
+ namespace delete test_ns_1
+ trace remove execution foo leave soom
+ set ::info
+} {SUCCESS 1 SUCCESS 1}
+
proc factorial {n} {
if {$n != 1} { return [expr {$n * [factorial [expr {$n -1 }]]}] }
return 1