summaryrefslogtreecommitdiffstats
path: root/tests/bgerror.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/bgerror.test')
-rw-r--r--tests/bgerror.test45
1 files changed, 27 insertions, 18 deletions
diff --git a/tests/bgerror.test b/tests/bgerror.test
index fa33d31..fd9594a 100644
--- a/tests/bgerror.test
+++ b/tests/bgerror.test
@@ -5,49 +5,58 @@
# Copyright (c) 1998-1999 by Scriptics Corporation.
# All rights reserved.
-package require tcltest 2.1
+package require tcltest 2.2
+namespace import ::tcltest::*
eval tcltest::configure $argv
tcltest::loadTestedCommands
-test bgerror-1.1 {bgerror / tkerror compat} {
+test bgerror-1.1 {bgerror / tkerror compat} -setup {
set errRes {}
proc tkerror {err} {
- global errRes;
- set errRes $err;
+ global errRes;
+ set errRes $err;
}
+} -body {
after 0 {error err1}
vwait errRes;
- set errRes;
-} err1
+ return $errRes;
+} -cleanup {
+ catch {rename tkerror {}}
+} -result {err1}
-test bgerror-1.2 {bgerror / tkerror compat / accumulation} {
+test bgerror-1.2 {bgerror / tkerror compat / accumulation} -setup {
set errRes {}
proc tkerror {err} {
- global errRes;
- lappend errRes $err;
+ global errRes;
+ lappend errRes $err;
}
+} -body {
after 0 {error err1}
after 0 {error err2}
after 0 {error err3}
update
- set errRes;
-} {err1 err2 err3}
+ return $errRes;
+} -cleanup {
+ catch {rename tkerror {}}
+} -result {err1 err2 err3}
-test bgerror-1.3 {bgerror / tkerror compat / accumulation / break} {
+test bgerror-1.3 {bgerror / tkerror compat / accumulation / break} -setup {
set errRes {}
proc tkerror {err} {
- global errRes;
- lappend errRes $err;
- return -code break "skip!";
+ global errRes;
+ lappend errRes $err;
+ return -code break "skip!";
}
+} -body {
after 0 {error err1}
after 0 {error err2}
after 0 {error err3}
update
- set errRes;
-} err1
+ return $errRes;
+} -cleanup {
+ catch {rename tkerror {}}
+} -result {err1}
-catch {rename tkerror {}}
# some testing of the default error dialog
# would be needed too, but that's not easy at all