summaryrefslogtreecommitdiffstats
path: root/tests/set-old.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/set-old.test')
-rw-r--r--tests/set-old.test25
1 files changed, 24 insertions, 1 deletions
diff --git a/tests/set-old.test b/tests/set-old.test
index f77709b..78a5005 100644
--- a/tests/set-old.test
+++ b/tests/set-old.test
@@ -12,7 +12,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# SCCS: @(#) set-old.test 1.25 97/12/16 13:35:36
+# RCS: @(#) $Id: set-old.test,v 1.1.2.2 1998/09/24 23:59:35 stanton Exp $
if {[string compare test [info procs test]] == 1} then {source defs}
@@ -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