summaryrefslogtreecommitdiffstats
path: root/tests/proc.test
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2004-09-22 15:48:21 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2004-09-22 15:48:21 (GMT)
commit9cd2909333f98f2b80729361b1492be6b8da5b6c (patch)
tree7db172f915c75d1855a3c835d5b9a4989a435d62 /tests/proc.test
parent9668a0e54abfdea9c4249e5ff8fffcb9acc8c96a (diff)
downloadtcl-9cd2909333f98f2b80729361b1492be6b8da5b6c.zip
tcl-9cd2909333f98f2b80729361b1492be6b8da5b6c.tar.gz
tcl-9cd2909333f98f2b80729361b1492be6b8da5b6c.tar.bz2
* generic/tclExecute.c (INST_START_CMD):
* tests/proc.test (7.2-3): fix for [Bug 729692] was incorrect whenever a loop exception was returned.
Diffstat (limited to 'tests/proc.test')
-rw-r--r--tests/proc.test32
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/proc.test b/tests/proc.test
index 988fb0f..bef0948 100644
--- a/tests/proc.test
+++ b/tests/proc.test
@@ -13,7 +13,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: proc.test,v 1.16 2004/05/19 12:54:56 dkf Exp $
+# RCS: @(#) $Id: proc.test,v 1.17 2004/09/22 15:48:23 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -333,6 +333,36 @@ test proc-7.1 {Redefining a compiled cmd: Bug 729692} {
foo
} bar
+test proc-7.2 {Shadowing a compiled cmd: Bug 729692} {
+ namespace eval ugly {}
+ proc ugly::foo {} {
+ proc set args {return bar}
+ set x 1
+ }
+ set res [list [catch {ugly::foo} msg] $msg]
+ namespace delete ugly
+ set res
+} {0 bar}
+
+test proc-7.3 {Returning loop exception from redefined cmd: Bug 729692} {
+ namespace eval ugly {}
+ proc ugly::foo {} {
+ set i 0
+ while { 1 } {
+ if { [incr i] > 3 } {
+ proc continue {} {return -code break}
+ }
+ continue
+ }
+ return $i
+ }
+ set res [list [catch {ugly::foo} msg] $msg]
+ namespace delete ugly
+ set res
+} {0 4}
+
+
+
# cleanup
catch {rename p ""}
catch {rename t ""}