summaryrefslogtreecommitdiffstats
path: root/tests/basic.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2004-11-18 19:22:07 (GMT)
committerdgp <dgp@users.sourceforge.net>2004-11-18 19:22:07 (GMT)
commit4e5e1d3ec698a9eb79f0201885584f3f8d233d35 (patch)
treeb799cc820fa33ab33c4d999c17c6882513c0865e /tests/basic.test
parent3727bd7f9afd5d6505ad727831ed2afc3723c316 (diff)
downloadtcl-4e5e1d3ec698a9eb79f0201885584f3f8d233d35.zip
tcl-4e5e1d3ec698a9eb79f0201885584f3f8d233d35.tar.gz
tcl-4e5e1d3ec698a9eb79f0201885584f3f8d233d35.tar.bz2
* tests/basic.test: Updated functional (not testing) uses of
* tests/io.test: [bgerror] to make use of [interp bgerror]. * tests/socket.test: * tests/timer.test: * generic/tclInterp.c: Corrected [interp bgerror] error message.
Diffstat (limited to 'tests/basic.test')
-rw-r--r--tests/basic.test22
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} {
} {}