summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorericm <ericm>2000-01-21 03:29:13 (GMT)
committerericm <ericm>2000-01-21 03:29:13 (GMT)
commitac4b7b9af8a470c5eace5289a1baa2272b88d8ac (patch)
treea768d15a2696f9c09dbf4f2cee292c1b142f1363 /tests
parente5a18035ecf52ade66229700d86a7c2f98253559 (diff)
downloadtcl-ac4b7b9af8a470c5eace5289a1baa2272b88d8ac.zip
tcl-ac4b7b9af8a470c5eace5289a1baa2272b88d8ac.tar.gz
tcl-ac4b7b9af8a470c5eace5289a1baa2272b88d8ac.tar.bz2
* var.test: Added tests for corrected variable behavior (bug #981).
* upvar.n: Expanded explanation of upvar behavior with respect to variable traces. (bugs 3917 1433 2110). * tclVar.c: Changed behavior of variable command when name refers to an element in an array (ie, "variable foo(x)") to always return an error, regardless of existance of that element in the array (now behavior is consistant with docs too) (bug #981).
Diffstat (limited to 'tests')
-rw-r--r--tests/var.test16
1 files changed, 15 insertions, 1 deletions
diff --git a/tests/var.test b/tests/var.test
index d363563..c4bb0c5 100644
--- a/tests/var.test
+++ b/tests/var.test
@@ -14,7 +14,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: var.test,v 1.12 2000/01/21 03:26:04 hobbs Exp $
+# RCS: @(#) $Id: var.test,v 1.13 2000/01/21 03:29:14 ericm Exp $
#
if {[lsearch [namespace children] ::tcltest] == -1} {
@@ -459,6 +459,20 @@ test var-7.13 {Tcl_VariableObjCmd, variable named ":"} {
p
}
} {{My name is ":"} :}
+test var-7.14 {Tcl_VariableObjCmd, array element parameter} {
+ catch {namespace eval test_ns_var { variable arrayvar(1) }} res
+ set res
+} "can't define \"arrayvar(1)\": name refers to an element in an array"
+test var-7.15 {Tcl_VariableObjCmd, array element parameter} {
+ catch {
+ namespace eval test_ns_var {
+ variable arrayvar
+ set arrayvar(1) x
+ variable arrayvar(1) y
+ }
+ } res
+ set res
+} "can't define \"arrayvar(1)\": name refers to an element in an array"
test var-8.1 {TclDeleteVars, "unset" traces are called with fully-qualified var names} {
catch {namespace delete test_ns_var}