summaryrefslogtreecommitdiffstats
path: root/tests/dict.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2014-06-04 08:15:26 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2014-06-04 08:15:26 (GMT)
commita6f4af7b107ac8381f33d4da361aef7825bd7d6b (patch)
tree6b5edf25c7e7634f8db2dd3b07709c39832f8f88 /tests/dict.test
parent8588f0dc476ae4dd0a3a0e0e6a4e7eae0a767cc2 (diff)
downloadtcl-a6f4af7b107ac8381f33d4da361aef7825bd7d6b.zip
tcl-a6f4af7b107ac8381f33d4da361aef7825bd7d6b.tar.gz
tcl-a6f4af7b107ac8381f33d4da361aef7825bd7d6b.tar.bz2
more tests, cleaning up the code a bit
Diffstat (limited to 'tests/dict.test')
-rw-r--r--tests/dict.test29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/dict.test b/tests/dict.test
index 1ccad7c..ae6f42a 100644
--- a/tests/dict.test
+++ b/tests/dict.test
@@ -176,9 +176,38 @@ test dict-4.12 {dict replace command: canonicality forced by update} {
test dict-4.13 {dict replace command: type check is mandatory} -body {
dict replace { a b c d e }
} -returnCodes error -result {missing value to go with key}
+test dict-4.13a {dict replace command: type check is mandatory} {
+ catch {dict replace { a b c d e }} -> opt
+ dict get $opt -errorcode
+} {TCL VALUE DICTIONARY}
test dict-4.14 {dict replace command: type check is mandatory} -body {
dict replace { a b {}c d }
} -returnCodes error -result {list element in braces followed by "c" instead of space}
+test dict-4.14a {dict replace command: type check is mandatory} {
+ catch {dict replace { a b {}c d }} -> opt
+ dict get $opt -errorcode
+} {TCL VALUE DICTIONARY}
+test dict-4.15 {dict replace command: type check is mandatory} -body {
+ dict replace { a b ""c d }
+} -returnCodes error -result {list element in quotes followed by "c" instead of space}
+test dict-4.15a {dict replace command: type check is mandatory} {
+ catch {dict replace { a b ""c d }} -> opt
+ dict get $opt -errorcode
+} {TCL VALUE DICTIONARY}
+test dict-4.16 {dict replace command: type check is mandatory} -body {
+ dict replace " a b \"c d "
+} -returnCodes error -result {unmatched open quote in list}
+test dict-4.16a {dict replace command: type check is mandatory} {
+ catch {dict replace " a b \"c d "} -> opt
+ dict get $opt -errorcode
+} {TCL VALUE DICTIONARY}
+test dict-4.17 {dict replace command: type check is mandatory} -body {
+ dict replace " a b \{c d "
+} -returnCodes error -result {unmatched open brace in list}
+test dict-4.17a {dict replace command: type check is mandatory} {
+ catch {dict replace " a b \{c d "} -> opt
+ dict get $opt -errorcode
+} {TCL VALUE DICTIONARY}
test dict-5.1 {dict remove command} {dict remove {a b c d} a} {c d}
test dict-5.2 {dict remove command} {dict remove {a b c d} c} {a b}