summaryrefslogtreecommitdiffstats
path: root/tests/error.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2006-01-11 17:15:46 (GMT)
committerdgp <dgp@users.sourceforge.net>2006-01-11 17:15:46 (GMT)
commit45515f86bb2c9932623f654aa25af42b1d0c4e7a (patch)
treec2793c345451cea93bccbe392e12822f1b0e850b /tests/error.test
parentcc9e0b11fb71dce048e0df824105ce845ce3ff14 (diff)
downloadtcl-45515f86bb2c9932623f654aa25af42b1d0c4e7a.zip
tcl-45515f86bb2c9932623f654aa25af42b1d0c4e7a.tar.gz
tcl-45515f86bb2c9932623f654aa25af42b1d0c4e7a.tar.bz2
* tests/error.test (error-7.0): Test the timing of write traces
on ::errorInfo [Bug 1397843].
Diffstat (limited to 'tests/error.test')
-rw-r--r--tests/error.test22
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/error.test b/tests/error.test
index 737faa4..b79a21f 100644
--- a/tests/error.test
+++ b/tests/error.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: error.test,v 1.9.2.1 2004/10/26 20:14:36 dgp Exp $
+# RCS: @(#) $Id: error.test,v 1.9.2.2 2006/01/11 17:15:47 dgp Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -200,6 +200,26 @@ test error-6.9 {catch must reset error state} {
list $errorCode
} {NONE}
+namespace eval ::tcl::test::error {
+ test error-7.0 {Bug 1397843} -body {
+ variable cmds
+ proc EIWrite args {
+ variable cmds
+ lappend cmds [lindex [info level -2] 0]
+ }
+ proc BadProc {} {
+ set i a
+ incr i
+ }
+ trace add variable ::errorInfo write [namespace code EIWrite]
+ catch BadProc
+ trace remove variable ::errorInfo write [namespace code EIWrite]
+ set cmds
+ } -match glob -result {*BadProc*}
+}
+namespace delete ::tcl::test::error
+
+
# cleanup
catch {rename p ""}