diff options
Diffstat (limited to 'tests/timer.test')
-rw-r--r-- | tests/timer.test | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tests/timer.test b/tests/timer.test index 2954507..800857b 100644 --- a/tests/timer.test +++ b/tests/timer.test @@ -13,7 +13,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: timer.test,v 1.10 2004/09/07 19:12:42 kennykb Exp $ +# RCS: @(#) $Id: timer.test,v 1.11 2004/11/18 19:22:14 dgp Exp $ if {[lsearch [namespace children] ::tcltest] == -1} { package require tcltest @@ -455,20 +455,22 @@ test timer-8.1 {AfterProc procedure} { } list [foo] $x } {untouched after} -test timer-8.2 {AfterProc procedure} { - catch {rename bgerror {}} - proc bgerror msg { - global x errorInfo - set x [list $msg $errorInfo] +test timer-8.2 {AfterProc procedure} -setup { + variable x empty + proc myHandler {msg options} { + variable x [list $msg [dict get $options -errorinfo]] } - set x empty + set handler [interp bgerror {}] + interp bgerror {} [namespace which myHandler] +} -body { after 100 {error "After error"} after 200 set y $x update - catch {rename bgerror {}} list $y $x -} {empty {{After error} {After error +} -cleanup { + interp bgerror {} $handler +} -result {empty {{After error} {After error while executing "error "After error"" ("after" script)}}} |