aboutsummaryrefslogtreecommitdiff
path: root/tests/try.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/try.test')
-rw-r--r--tests/try.test11
1 files changed, 9 insertions, 2 deletions
diff --git a/tests/try.test b/tests/try.test
index 7435763..a2bb38a 100644
--- a/tests/try.test
+++ b/tests/try.test
@@ -1,4 +1,5 @@
-source testing.tcl
+source [file dirname [info script]]/testing.tcl
+needs cmd try tclcompat
test try-1.1 "Simple case" {
try {
@@ -100,7 +101,11 @@ proc c {} {
try {
error here
} on error {msg opts} {
- incr opts(-level)
+ # jim can do simply:
+ if {[catch {incr opts(-level)}]} {
+ # Must be Tcl
+ dict incr opts -level
+ }
return {*}$opts $msg
}
}
@@ -108,3 +113,5 @@ proc c {} {
test try-3.1 "rethrow error in try/on handler" {
list [catch c msg] $msg
} {1 here}
+
+testreport