summaryrefslogtreecommitdiffstats
path: root/tests/dict.test
diff options
context:
space:
mode:
authorgriffin <briang42@easystreet.net>2022-11-08 22:02:33 (GMT)
committergriffin <briang42@easystreet.net>2022-11-08 22:02:33 (GMT)
commit4335a4f4756de329d8abe3cf77fae90b8e664faf (patch)
treeaac673769f067b26e6dab2757a49e622c79bf607 /tests/dict.test
parent3e26e1b26d51cbdb08e4569e5c6eea5c21d21dbc (diff)
downloadtcl-4335a4f4756de329d8abe3cf77fae90b8e664faf.zip
tcl-4335a4f4756de329d8abe3cf77fae90b8e664faf.tar.gz
tcl-4335a4f4756de329d8abe3cf77fae90b8e664faf.tar.bz2
Remove unused/incomplete functions. Some cleanup.
Diffstat (limited to 'tests/dict.test')
-rw-r--r--tests/dict.test31
1 files changed, 20 insertions, 11 deletions
diff --git a/tests/dict.test b/tests/dict.test
index d67f703..fe4f498 100644
--- a/tests/dict.test
+++ b/tests/dict.test
@@ -27,6 +27,7 @@ if {[testConstraint memory]} {
expr {$end - $tmp}
}
}
+
test dict-1.1 {dict command basic syntax} -returnCodes error -body {
dict
@@ -138,8 +139,16 @@ test dict-3.15 {compiled dict get error cleanliness - Bug 2431847} -body {
dict get $a(z) d
}}
} -returnCodes error -result {key "d" not known in dictionary}
-test dict-3.16 {dict/list shimmering - Bug 3004007} {set l [list p 1 p 2 q 3];dict get $l q;set l} {p 1 p 2 q 3}
-test dict-3.17 {dict/list shimmering - Bug 3004007} {set l [list p 1 p 2 q 3];dict get $l q;llength $l} 6
+test dict-3.16 {dict/list shimmering - Bug 3004007} {
+ set l [list p 1 p 2 q 3]
+ dict get $l q
+ list $l [testobj objtype $l]
+} {{p 1 p 2 q 3} dict}
+test dict-3.17 {dict/list shimmering - Bug 3004007} {
+ set l [list p 1 p 2 q 3]
+ dict get $l q
+ list [llength $l] [testobj objtype $l]
+} {6 dict}
test dict-4.1 {dict replace command} {
dict replace {a b c d}
@@ -662,15 +671,15 @@ test dict-14.14 {dict for command: handle representation loss} -body {
set keys {}
set values {}
dict for {k v} $dictVar {
- if {[llength $dictVar]} {
+ if {[string length $dictVar]} {
lappend keys $k
lappend values $v
}
}
- list [lsort $keys] [lsort $values]
+ list [lsort $keys] [lsort $values] [testobj objtype $dictVar]
} -cleanup {
unset dictVar keys values k v
-} -result {{a c e g} {b d f h}}
+} -result {{a c e g} {b d f h} string}
test dict-14.15 {dict for command: keys are unique and iterated over once only} -setup {
unset -nocomplain accum
array set accum {}
@@ -1808,27 +1817,27 @@ test dict-24.14 {dict map command: handle representation loss} -setup {
} -body {
set dictVar {a b c d e f g h}
list [dict size [dict map {k v} $dictVar {
- if {[llength $dictVar]} {
+ if {[string length $dictVar]} {
lappend keys $k
lappend values $v
return -level 0 $k
}
- }]] [lsort $keys] [lsort $values]
+ }]] [lsort $keys] [lsort $values] [testobj objtype $dictVar]
} -cleanup {
unset dictVar keys values k v
-} -result {4 {a c e g} {b d f h}}
+} -result {4 {a c e g} {b d f h} string}
test dict-24.14a {dict map command: handle representation loss} -body {
apply {{} {
set dictVar {a b c d e f g h}
list [dict size [dict map {k v} $dictVar {
- if {[llength $dictVar]} {
+ if {[string length $dictVar]} {
lappend keys $k
lappend values $v
return -level 0 $k
}
- }]] [lsort $keys] [lsort $values]
+ }]] [lsort $keys] [lsort $values] [testobj objtype $dictVar]
}}
-} -result {4 {a c e g} {b d f h}}
+} -result {4 {a c e g} {b d f h} string}
test dict-24.15 {dict map command: keys are unique and iterated over once only} -setup {
unset -nocomplain accum
array set accum {}