summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2014-06-07 14:18:40 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2014-06-07 14:18:40 (GMT)
commit860a7252bb242157af32c222cca494d3d9635bc4 (patch)
tree92e97e060472f0662cb300189f025d1c30885d4f /tests
parent0fbfb196c3b93d788a90aecc5b76dfedbbd9f007 (diff)
downloadtcl-860a7252bb242157af32c222cca494d3d9635bc4.zip
tcl-860a7252bb242157af32c222cca494d3d9635bc4.tar.gz
tcl-860a7252bb242157af32c222cca494d3d9635bc4.tar.bz2
Improved the error messages.
We do not want parsing an invalid dictionary to give errors about lists! As compensation, we get greater precision in the errorcode.
Diffstat (limited to 'tests')
-rw-r--r--tests/dict.test20
1 files changed, 10 insertions, 10 deletions
diff --git a/tests/dict.test b/tests/dict.test
index ae6f42a..1439af9 100644
--- a/tests/dict.test
+++ b/tests/dict.test
@@ -182,32 +182,32 @@ test dict-4.13a {dict replace command: type check is mandatory} {
} {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}
+} -returnCodes error -result {dict 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}
+} {TCL VALUE DICTIONARY JUNK}
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}
+} -returnCodes error -result {dict 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}
+} {TCL VALUE DICTIONARY JUNK}
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}
+} -returnCodes error -result {unmatched open quote in dict}
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}
+} {TCL VALUE DICTIONARY QUOTE}
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}
+} -returnCodes error -result {unmatched open brace in dict}
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}
+} {TCL VALUE DICTIONARY BRACE}
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}
@@ -234,7 +234,7 @@ test dict-5.11 {dict remove command: type check is mandatory} -body {
} -returnCodes error -result {missing value to go with key}
test dict-5.12 {dict remove command: type check is mandatory} -body {
dict remove { a b {}c d }
-} -returnCodes error -result {list element in braces followed by "c" instead of space}
+} -returnCodes error -result {dict element in braces followed by "c" instead of space}
test dict-6.1 {dict keys command} {dict keys {a b}} a
test dict-6.2 {dict keys command} {dict keys {c d}} c
@@ -1296,7 +1296,7 @@ test dict-20.24 {dict merge command: type check is mandatory} -body {
} -returnCodes error -result {missing value to go with key}
test dict-20.25 {dict merge command: type check is mandatory} -body {
dict merge { a b {}c d }
-} -returnCodes error -result {list element in braces followed by "c" instead of space}
+} -returnCodes error -result {dict element in braces followed by "c" instead of space}
test dict-21.1 {dict update command} -returnCodes 1 -body {
dict update