aboutsummaryrefslogtreecommitdiff
path: root/tests/dict2.test
diff options
context:
space:
mode:
authorSteve Bennett <steveb@workware.net.au>2020-04-18 09:34:25 +1000
committerSteve Bennett <steveb@workware.net.au>2020-05-04 21:57:34 +1000
commitda82368c816c8d06f425aa3f25a2a918fdba1df1 (patch)
treee1dc05358910d168edc982ed05523d0b30ad24d5 /tests/dict2.test
parent8a5861eb51c32e41d638181188c256c1dbb93c96 (diff)
downloadjimtcl-da82368c816c8d06f425aa3f25a2a918fdba1df1.zip
jimtcl-da82368c816c8d06f425aa3f25a2a918fdba1df1.tar.gz
jimtcl-da82368c816c8d06f425aa3f25a2a918fdba1df1.tar.bz2
tests: Add many new additional tests for code coverage
readdir, tty, utf8, signal, alarm, kill, file, jimsh, posix, aio, history, interp, pack, unpack, eventloop, exec, load, package, regexp, regsub Signed-off-by: Steve Bennett <steveb@workware.net.au>
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