diff options
Diffstat (limited to 'tests/basic.test')
-rw-r--r-- | tests/basic.test | 43 |
1 files changed, 42 insertions, 1 deletions
diff --git a/tests/basic.test b/tests/basic.test index a459e07..8a3e703 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.17 2002/03/27 14:35:40 msofer Exp $ +# RCS: @(#) $Id: basic.test,v 1.18 2002/03/29 21:01:12 dgp Exp $ # if {[lsearch [namespace children] ::tcltest] == -1} { @@ -597,6 +597,47 @@ invoked "break" outside of a loop "break" (file "BREAKtest" line 3)}} +test basic-46.3 {Tcl_AllowExceptions: exception return not allowed} { + makeFile { + interp alias {} patch {} info patchlevel + patch + break + } BREAKtest + set res [list [catch {exec [info nameofexecutable] BREAKtest} msg] $msg] + removeFile BREAKtest + set res +} {1 {invoked "break" outside of a loop + while executing +"break" + (file "BREAKtest" line 4)}} + +test basic-46.4 {Tcl_AllowExceptions: exception return not allowed} { + makeFile { + foo [set a 1] [break] + } BREAKtest + set res [list [catch {exec [info nameofexecutable] BREAKtest} msg] $msg] + removeFile BREAKtest + set res +} {1 {invoked "break" outside of a loop + while executing +"break" + invoked from within +"foo [set a 1] [break]" + (file "BREAKtest" line 2)}} + +test basic-46.5 {Tcl_AllowExceptions: exception return not allowed} { + makeFile { + return -code return + } BREAKtest + set res [list [catch {exec [info nameofexecutable] BREAKtest} msg] $msg] + removeFile BREAKtest + set res +} {1 {command returned bad code: 2 + while executing +"return -code return" + (file "BREAKtest" line 2)}} + + # cleanup catch {eval namespace delete [namespace children :: test_ns_*]} catch {namespace delete george} |