1 source [file dirname [info script]]/testing.tcl
5 test return-1.1 {return -code} {
6 set script "return -code 4 result"
7 list [catch {eval $script} msg] $msg
10 test return-1.2 {source file with break} {
11 list [catch {source break.tcl} msg] $msg
14 test return-1.3 {source file with break} {
15 list [catch {source return-break.tcl} msg] $msg
18 proc a {level code msg} {
19 return -level $level -code $code $msg
22 proc b {level code msg} {
26 test return-2.1 {return -level 0} {
27 list [catch {a 0 20 text} msg] $msg
30 test return-2.2 {return -level 1} {
31 list [catch {a 1 20 text} msg] $msg
34 test return-2.3 {return -level 2} {
35 list [catch {a 2 20 text} msg] $msg
38 test return-2.4 {return -level 0} {
39 list [catch {b 0 20 text} msg] $msg
42 test return-2.5 {return -level 1} {
43 list [catch {b 1 20 text} msg] $msg
46 test return-2.6 {return -level 2} {
47 list [catch {b 2 20 text} msg] $msg