1 source [file dirname [info script]]/testing.tcl
2 needs cmd try tclcompat
4 test try-1.1 "Simple case" {
12 test try-1.2 "Error in body" {
23 test try-1.3 "Error in finally" {
34 test try-1.4 "Error in both" {
46 test try-1.5 "break in body" {
57 test try-1.6 "break in finally" {
68 test try-1.7 "return value from try, not finally" {
78 test try-1.8 "return from within try" {
89 test try-1.9 "return -code from within try" {
92 return -code break text
97 list [catch a msg] $msg
103 } on error {msg opts} {
105 if {[catch {incr opts(-level)}]} {
107 dict incr opts -level
113 test try-3.1 "rethrow error in try/on handler" {
114 list [catch c msg] $msg