diff options
author | Steve Bennett <steveb@workware.net.au> | 2020-04-17 08:36:16 +1000 |
---|---|---|
committer | Steve Bennett <steveb@workware.net.au> | 2020-04-17 17:36:50 +1000 |
commit | 30f1b1ce7a3755db94c31c77f6e013d84ab36a55 (patch) | |
tree | f5c0aa32059971df7a9950573f1475217110797e /tests/parse.test | |
parent | 1fe274439565fe4cf94559131ef820c4f61f4173 (diff) | |
download | jimtcl-30f1b1ce7a3755db94c31c77f6e013d84ab36a55.zip jimtcl-30f1b1ce7a3755db94c31c77f6e013d84ab36a55.tar.gz jimtcl-30f1b1ce7a3755db94c31c77f6e013d84ab36a55.tar.bz2 |
parsing: Fix error with missing quote
If a quote is missing inside a command, e.g.["command here]
the error should indicate that a quote is missing, not a bracket.
Signed-off-by: Steve Bennett <steveb@workware.net.au>
Diffstat (limited to 'tests/parse.test')
-rw-r--r-- | tests/parse.test | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/parse.test b/tests/parse.test index 8b03192..0194291 100644 --- a/tests/parse.test +++ b/tests/parse.test @@ -334,5 +334,26 @@ test parse-1.65 "double backslash in comment" { incr x } 2 +test parse-1.66 {backslash newline} { + proc "abc def" {x} { incr x; return $x } + set x ["abc\ + def" 4] +} {5} + +test parse-1.67 {missing quote in command} -body { + set x ["abc\ + def] +} -returnCodes error -match regexp -result {missing ("|quote)} + +test parse-1.68 {missing quote} -body { + set x "abc\ + line without quote + +} -returnCodes error -match regexp -result {missing ("|quote)} + +test parse-1.69 {comment with trailing backslash} { + set x "#abc \\" + eval $x +} {} testreport |