summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-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 ""}