summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorericm <ericm@noemail.net>2000-01-21 03:29:12 (GMT)
committerericm <ericm@noemail.net>2000-01-21 03:29:12 (GMT)
commit7ddf5074dfd0d363a565036a5f7fcf64ac173497 (patch)
treea768d15a2696f9c09dbf4f2cee292c1b142f1363 /tests
parent2fbc5c9d6042eff1c1d43b055695dabdee98393b (diff)
downloadtcl-7ddf5074dfd0d363a565036a5f7fcf64ac173497.zip
tcl-7ddf5074dfd0d363a565036a5f7fcf64ac173497.tar.gz
tcl-7ddf5074dfd0d363a565036a5f7fcf64ac173497.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). FossilOrigin-Name: 4521696b9889a95617c9e09d9b76d94efa5bd049
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}