aboutsummaryrefslogtreecommitdiff
path: root/tests/alias.test
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2011-04-12 09:15:57 +1000
committerSteve Bennett <steveb@workware.net.au>2011-06-01 12:05:18 +1000
commit14eeca4e8c1a62e68be012cacbad112c927df34b (patch)
treef83ebf44747abcc6970eb776c90c901e37ac9593 /tests/alias.test
parentca1d944f40971c53a76c5bdf2c45f277acfc2e0e (diff)
downloadjimtcl-14eeca4e8c1a62e68be012cacbad112c927df34b.zip
jimtcl-14eeca4e8c1a62e68be012cacbad112c927df34b.tar.gz
jimtcl-14eeca4e8c1a62e68be012cacbad112c927df34b.tar.bz2
local procs now keep and restore previous defn
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/alias.test')
-rw-r--r--tests/alias.test36
1 files changed, 36 insertions, 0 deletions
diff --git a/tests/alias.test b/tests/alias.test
index 4fd392d..bcafe04 100644
--- a/tests/alias.test
+++ b/tests/alias.test
@@ -156,4 +156,40 @@ test statics-1.4 "bad static variable init" {
}
} 1
+test local-2.1 "proc over existing proc" {
+ proc a {b} {incr b}
+ proc t {x} {
+ proc a {b} {incr b -1}
+ a $x
+ }
+ unset -nocomplain x
+ lappend x [a 5]
+ lappend x [t 5]
+ lappend x [a 5]
+} {6 4 4}
+
+test local-2.2 "local proc over existing proc" {
+ proc a {b} {incr b}
+ proc t {x} {
+ local proc a {b} {incr b -1}
+ a $x
+ }
+ unset -nocomplain x
+ lappend x [a 5]
+ lappend x [t 5]
+ lappend x [a 5]
+} {6 4 6}
+
+test local-2.3 "local proc over existing proc" {
+ proc a {b} {incr b}
+ proc t {x} {
+ local proc a {b} {incr b -1}
+ a $x
+ }
+ unset -nocomplain x
+ lappend x [a 5]
+ lappend x [t 5]
+ lappend x [a 5]
+} {6 4 6}
+
testreport