summaryrefslogtreecommitdiffstats
path: root/tests/trace.test
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2002-07-29 00:25:48 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2002-07-29 00:25:48 (GMT)
commit8aac5314070c34799ffa1a70feb28b35584bc49a (patch)
tree208b34b62a4fbd5ad2e737a2db9c09e81c11e01d /tests/trace.test
parent8ad6452f7dc366f56dcb758bea0740353758aa73 (diff)
downloadtcl-8aac5314070c34799ffa1a70feb28b35584bc49a.zip
tcl-8aac5314070c34799ffa1a70feb28b35584bc49a.tar.gz
tcl-8aac5314070c34799ffa1a70feb28b35584bc49a.tar.bz2
Fix for [Bug 582522] - aliases now fire execution traces on the target
command. Optimisation of alias invocation.
Diffstat (limited to 'tests/trace.test')
-rw-r--r--tests/trace.test29
1 files changed, 28 insertions, 1 deletions
diff --git a/tests/trace.test b/tests/trace.test
index 2229b69..10c70c9 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.20 2002/07/18 13:37:46 msofer Exp $
+# RCS: @(#) $Id: trace.test,v 1.21 2002/07/29 00:25:50 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -1805,6 +1805,32 @@ test trace-25.11 {delete command during enter and enterstep traces} {
list $err $info [trace info execution foo]
} {{invalid command name "foo"} {{foo 1} enter} {unknown command "foo"}}
+test trace-26.1 {trace targetCmd when invoked through an alias} {
+ proc foo {args} {
+ set b $args
+ }
+ set info {}
+ trace add execution foo enter [list traceExecute foo]
+ interp alias {} bar {} foo 1
+ bar 2
+ trace remove execution foo enter [list traceExecute foo]
+ set info
+} {{foo {foo 1 2} enter}}
+test trace-26.2 {trace targetCmd when invoked through an alias} {
+ proc foo {args} {
+ set b $args
+ }
+ set info {}
+ trace add execution foo enter [list traceExecute foo]
+ interp create child
+ interp alias child bar {} foo 1
+ child eval bar 2
+ interp delete child
+ trace remove execution foo enter [list traceExecute foo]
+ set info
+} {{foo {foo 1 2} enter}}
+
+
# Delete procedures when done, so we don't clash with other tests
# (e.g. foobar will clash with 'unknown' tests).
catch {rename foobar {}}
@@ -1814,3 +1840,4 @@ catch {rename bar {}}
# cleanup
::tcltest::cleanupTests
return
+