diff options
Diffstat (limited to 'tests/basic.test')
-rw-r--r-- | tests/basic.test | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/tests/basic.test b/tests/basic.test index dcd3a8a..da5449b 100644 --- a/tests/basic.test +++ b/tests/basic.test @@ -15,7 +15,7 @@ # See the file "license.terms" for information on usage and redistribution # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -# RCS: @(#) $Id: basic.test,v 1.35 2004/10/26 16:46:15 dgp Exp $ +# RCS: @(#) $Id: basic.test,v 1.36 2004/11/18 19:22:12 dgp Exp $ # package require tcltest 2 @@ -414,23 +414,29 @@ test basic-24.3 {Tcl_DeleteCommandFromToken, delete imported cmds that refer to test basic-25.1 {TclCleanupCommand} {emptyTest} { } {} -test basic-26.1 {Tcl_EvalObj: preserve object while evaling it} { +test basic-26.1 {Tcl_EvalObj: preserve object while evaling it} -setup { + proc myHandler {msg options} { + set ::x [dict get $options -errorinfo] + } + set handler [interp bgerror {}] + interp bgerror {} [namespace which myHandler] + set fName [makeFile {} test1] +} -body { # If object isn't preserved, errorInfo would be set to # "foo\n while executing\n\"garbage bytes\"" because the object's # string would have been freed, leaving garbage bytes for the error # message. - - proc bgerror {args} {set ::x $::errorInfo} - set fName [makeFile {} test1] set f [open $fName w] fileevent $f writable "fileevent $f writable {}; error foo" set x {} vwait x close $f - removeFile test1 - rename bgerror {} set x -} "foo\n while executing\n\"error foo\"" +} -cleanup { + removeFile test1 + interp bgerror {} $handler + rename myHandler {} +} -result "foo\n while executing\n\"error foo\"" test basic-27.1 {Tcl_ExprLong} {emptyTest} { } {} |