summaryrefslogtreecommitdiffstats
path: root/tests/basic.test
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2002-03-29 21:01:11 (GMT)
committerdgp <dgp@users.sourceforge.net>2002-03-29 21:01:11 (GMT)
commitcb3ffc68aefa6b11adf7c31ae97da681a91b8c04 (patch)
tree45d34400a0d6c9126eb259f658c44f63e2fc1b02 /tests/basic.test
parentecdc61ad73b61ea283f30fa6cd4e25f39521f59e (diff)
downloadtcl-cb3ffc68aefa6b11adf7c31ae97da681a91b8c04.zip
tcl-cb3ffc68aefa6b11adf7c31ae97da681a91b8c04.tar.gz
tcl-cb3ffc68aefa6b11adf7c31ae97da681a91b8c04.tar.bz2
* Corrected problems with Tcl_AllowExceptions
having influence over the wrong scope of Tcl_*Eval* calls. Patch from Miguel Sofer. Report from Jean-Claude Wippler. [Bug 219181]
Diffstat (limited to 'tests/basic.test')
-rw-r--r--tests/basic.test43
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}