diff options
author | Steve Bennett <steveb@workware.net.au> | 2014-01-06 16:25:14 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2014-01-15 07:46:33 +1000 |
commit | 6ed588b21d8e644c21bb6e7fce602cd90dae7343 (patch) | |
tree | 386bea32f8b0a20a8a1a2835b01846ad2501227a /tests/namespace.test | |
parent | 1ef6d203d8e5ea0b7b03f0ffd9bde58b1b18299a (diff) | |
download | jimtcl-6ed588b21d8e644c21bb6e7fce602cd90dae7343.zip jimtcl-6ed588b21d8e644c21bb6e7fce602cd90dae7343.tar.gz jimtcl-6ed588b21d8e644c21bb6e7fce602cd90dae7343.tar.bz2 |
namespace: disallow array element syntax for variables
Detect and generate an appropriate message if the variable name
is an array element (dict sugar syntax)
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/namespace.test')
-rw-r--r-- | tests/namespace.test | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/namespace.test b/tests/namespace.test index 5707cf8..98acf3e 100644 --- a/tests/namespace.test +++ b/tests/namespace.test @@ -133,6 +133,12 @@ test namespace-1.27 {can create commands with null names} { ns1:: x } {x} +test namespace-1.28 {namespace variable with array element syntax} -body { + namespace eval ns1 { + variable x(3) y + } +} -returnCodes error -result {can't define "x(3)": name refers to an element in an array} + unset -nocomplain ns1::x ns1::y # ----------------------------------------------------------------------- |