summaryrefslogtreecommitdiffstats
path: root/tests/trace.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2006-02-28 15:44:35 (GMT)
committerdgp <dgp@users.sourceforge.net>2006-02-28 15:44:35 (GMT)
commitaea6c6f98570eb34604011e06d7fc4d5b9cc256a (patch)
tree0b98b7f4840ce4ea0d3d4c45a12c943727b140a3 /tests/trace.test
parent07a404f12e65c2c31b9f326556b7067abd8c9548 (diff)
downloadtcl-aea6c6f98570eb34604011e06d7fc4d5b9cc256a.zip
tcl-aea6c6f98570eb34604011e06d7fc4d5b9cc256a.tar.gz
tcl-aea6c6f98570eb34604011e06d7fc4d5b9cc256a.tar.bz2
* generic/tclBasic.c: Corrections to be sure that TCL_EVAL_GLOBAL
* tests/parse.test: evaluations act the same as [uplevel #0] * tests/trace.test: evaluations, even when execution traces or invocations of [::unknown] are present. [Bug 1439836].
Diffstat (limited to 'tests/trace.test')
-rw-r--r--tests/trace.test36
1 files changed, 35 insertions, 1 deletions
diff --git a/tests/trace.test b/tests/trace.test
index 4409fe1..21536ad 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.26.2.14 2005/11/18 23:44:37 msofer Exp $
+# RCS: @(#) $Id: trace.test,v 1.26.2.15 2006/02/28 15:44:36 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -21,6 +21,8 @@ if {[lsearch [namespace children] ::tcltest] == -1} {
# Used for constraining memory leak tests
testConstraint memory [llength [info commands memory]]
+testConstraint testevalobjv [llength [info commands testevalobjv]]
+
proc getbytes {} {
set lines [split [memory info] "\n"]
lindex [lindex $lines 3] 3
@@ -1590,6 +1592,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