summaryrefslogtreecommitdiffstats
path: root/tests/set-old.test
diff options
context:
space:
mode:
authorstanton <stanton>1998-06-18 18:25:58 (GMT)
committerstanton <stanton>1998-06-18 18:25:58 (GMT)
commite27be7921a7f70adf89b0c59b976c96c32fae7a8 (patch)
tree0e642457c83579949f1c862535263886e6e1b374 /tests/set-old.test
parent75b521227f47c2241a4edb7d1e913ac348f05f12 (diff)
downloadtcl-e27be7921a7f70adf89b0c59b976c96c32fae7a8.zip
tcl-e27be7921a7f70adf89b0c59b976c96c32fae7a8.tar.gz
tcl-e27be7921a7f70adf89b0c59b976c96c32fae7a8.tar.bz2
*** empty log message ***
Diffstat (limited to 'tests/set-old.test')
-rw-r--r--tests/set-old.test23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/set-old.test b/tests/set-old.test
index a101e7b..12944f3 100644
--- a/tests/set-old.test
+++ b/tests/set-old.test
@@ -474,6 +474,29 @@ test set-old-8.37 {array command, set option} {
array set aVaRnAmE {}
list [info exists aVaRnAmE] [catch {set aVaRnAmE} msg] $msg
} {1 1 {can't read "aVaRnAmE": variable is array}}
+test set-old-8.37.1 {array command, set scalar} {
+ catch {unset aVaRnAmE}
+ set aVaRnAmE 1
+ list [catch {array set aVaRnAmE {}} msg] $msg
+} {1 {can't array set "aVaRnAmE": variable isn't array}}
+test set-old-8.37.2 {array command, set alias} {
+ catch {unset aVaRnAmE}
+ upvar 0 aVaRnAmE anAliAs
+ array set anAliAs {}
+ list [array exists aVaRnAmE] [catch {set anAliAs} msg] $msg
+} {1 1 {can't read "anAliAs": variable is array}}
+test set-old-8.37.3 {array command, set element alias} {
+ catch {unset aVaRnAmE}
+ list [catch {upvar 0 aVaRnAmE(elem) elemAliAs}] \
+ [catch {array set elemAliAs {}} msg] $msg
+} {0 1 {can't array set "elemAliAs": variable isn't array}}
+test set-old-8.37.4 {array command, empty set with populated array} {
+ catch {unset aVaRnAmE}
+ array set aVaRnAmE [list e1 v1 e2 v2]
+ array set aVaRnAmE {}
+ array set aVaRnAmE [list e3 v3]
+ list [lsort [array names aVaRnAmE]] [catch {set aVaRnAmE(e2)} msg] $msg
+} {{e1 e2 e3} 0 v2}
test set-old-8.38 {array command, size option} {
catch {unset a}
array size a