aboutsummaryrefslogtreecommitdiff
path: root/tests/dict2.test
diff options
context:
space:
mode:
Diffstat (limited to 'tests/dict2.test')
-rw-r--r--tests/dict2.test32
1 files changed, 31 insertions, 1 deletions
diff --git a/tests/dict2.test b/tests/dict2.test
index 54d4d0d..f4d147a 100644
--- a/tests/dict2.test
+++ b/tests/dict2.test
@@ -95,7 +95,7 @@ test dict-3.10 {dict get command} -returnCodes error -body {
test dict-3.11 {dict get command} {dict get [dict create a b c d] a} b
test dict-3.12 {dict get command} -returnCodes error -body {
dict get
-} -result {wrong # args: should be "dict get dictionary ?key ...?"}
+} -match glob -result {wrong # args: should be "dict get dictionary ?key*?"}
test dict-3.13 {dict get command} -body {
set dict [dict get {a b c d}]
if {$dict eq "a b c d"} {
@@ -1250,5 +1250,35 @@ test dict-22.11 {dict with command: no recursive structures [Bug 1786481]} -body
} -cleanup {
unset foo t inner
} -result OK
+
+set dictnulls {ab\0c de\0f \0ghi kl\0m}
+set dictgood [array get tcl_platform]
+set dictbad {abc def ghi}
+
+test dict-23.1 {dict info} {
+ regexp {entries in table,.*buckets} [dict info $dictgood]
+} {1}
+
+test dict-23.2 {dict info usage} -body {
+ dict info
+} -returnCodes error -result {wrong # args: should be "dict info dictionary"}
+
+test dict-23.3 {dict info baddict} -body {
+ dict info $dictbad
+} -returnCodes error -result {missing value to go with key}
+
+test dict-23.4 {dict with usage} -body {
+ dict with
+} -returnCodes error -result {wrong # args: should be "dict with dictVar ?key ...? script"}
+
+test dict-23.5 {dict with badvar} -constraints jim -body {
+ # set up a variable that will fail Jim_SetVariable()
+ dict with dictnulls {}
+} -returnCodes error -result {variable name contains embedded null}
+
+test dict-23.6 {dict with baddict} -body {
+ dict with dictbad {}
+} -returnCodes error -result {missing value to go with key}
+
testreport