summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2007-11-03 01:47:12 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2007-11-03 01:47:12 (GMT)
commit71b6a5824485a25d8b7be9c26103252cb50ed5f6 (patch)
treee87f0eb9027e31b26dabecc59d6579c5a44d8d8c /tests
parentc7d4f0143c9004a2ad087ba1faf97eaec526c3e2 (diff)
downloadtcl-71b6a5824485a25d8b7be9c26103252cb50ed5f6.zip
tcl-71b6a5824485a25d8b7be9c26103252cb50ed5f6.tar.gz
tcl-71b6a5824485a25d8b7be9c26103252cb50ed5f6.tar.bz2
* generic/tclTest.c (TestSetCmd2):
* generic/tclVar.c (TclObjLookupVarEx): * tests/set.test (set-5.1): fix error branch when array name looks like array element (code not normally exercised). x
Diffstat (limited to 'tests')
-rw-r--r--tests/set.test9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/set.test b/tests/set.test
index 3ac1560..0704436 100644
--- a/tests/set.test
+++ b/tests/set.test
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: set.test,v 1.12 2007/10/15 21:27:50 dgp Exp $
+# RCS: @(#) $Id: set.test,v 1.13 2007/11/03 01:47:13 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest 2
@@ -514,6 +514,13 @@ test set-4.6 {set command: runtime error, basic array operations} {
list [catch {$z a} msg] $msg
} {1 {can't read "a": variable is array}}
+test set-5.1 {error on malformed array name} {
+ unset -nocomplain z
+ catch {testset2 z(a) b} msg
+ catch {testset2 z(b) a} msg1
+ list $msg $msg1
+} {{can't read "z(a)(b)": variable isn't array} {can't read "z(b)(a)": variable isn't array}}
+
# cleanup
catch {unset a}
catch {unset b}