summaryrefslogtreecommitdiffstats
path: root/tests/if.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2001-12-04 15:36:29 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2001-12-04 15:36:29 (GMT)
commit5135eae0433e9c4fb96153356cce8f29f72c09a8 (patch)
tree274a2df1f90321771b312de400142f588d5eb264 /tests/if.test
parent1b5d4aa57d4fd6ffb21d7f5a0c08567eb0959714 (diff)
downloadtcl-5135eae0433e9c4fb96153356cce8f29f72c09a8.zip
tcl-5135eae0433e9c4fb96153356cce8f29f72c09a8.tar.gz
tcl-5135eae0433e9c4fb96153356cce8f29f72c09a8.tar.bz2
Improved messages produced on getting a syntax error in an expression
Diffstat (limited to 'tests/if.test')
-rw-r--r--tests/if.test24
1 files changed, 6 insertions, 18 deletions
diff --git a/tests/if.test b/tests/if.test
index 5cb269d..1c79ef2 100644
--- a/tests/if.test
+++ b/tests/if.test
@@ -10,7 +10,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: if.test,v 1.6 2001/09/19 18:17:54 hobbs Exp $
+# RCS: @(#) $Id: if.test,v 1.7 2001/12/04 15:36:29 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -28,7 +28,7 @@ test if-1.2 {TclCompileIfCmd: error in if/elseif test} {
} {1 {error in condition}}
test if-1.3 {TclCompileIfCmd: error in if/elseif test} {
list [catch {if {1+}} msg] $msg $errorInfo
-} {1 {syntax error in expression "1+"} {syntax error in expression "1+"
+} {1 {syntax error in expression "1+": premature end of expression} {syntax error in expression "1+": premature end of expression
("if" test expression)
while compiling
"if {1+}"}}
@@ -180,7 +180,7 @@ test if-2.3 {TclCompileIfCmd: missing expression after "elseif"} {
test if-2.4 {TclCompileIfCmd: error in expression after "elseif"} {
set a {}
list [catch {if 3>4 {set a 1} elseif {1>}} msg] $msg $errorInfo
-} {1 {syntax error in expression "1>"} {syntax error in expression "1>"
+} {1 {syntax error in expression "1>": premature end of expression} {syntax error in expression "1>": premature end of expression
("if" test expression)
while compiling
"if 3>4 {set a 1} elseif {1>}"}}
@@ -512,7 +512,7 @@ test if-5.2 {if cmd with computed command names: error in if/elseif test} {
test if-5.3 {if cmd with computed command names: error in if/elseif test} {
set z if
list [catch {$z {1+}} msg] $msg $errorInfo
-} {1 {syntax error in expression "1+"} {syntax error in expression "1+"
+} {1 {syntax error in expression "1+": premature end of expression} {syntax error in expression "1+": premature end of expression
while executing
"$z {1+}"}}
test if-5.4 {if cmd with computed command names: if/elseif test in braces} {
@@ -680,7 +680,7 @@ test if-6.4 {if cmd with computed command names: error in expression after "else
set z if
set a {}
list [catch {$z 3>4 {set a 1} elseif {1>}} msg] $msg $errorInfo
-} {1 {syntax error in expression "1>"} {syntax error in expression "1>"
+} {1 {syntax error in expression "1>": premature end of expression} {syntax error in expression "1>": premature end of expression
while executing
"$z 3>4 {set a 1} elseif {1>}"}}
test if-6.5 {if cmd with computed command names: test jumpFalse instruction replacement after long "elseif" body} {
@@ -1108,20 +1108,8 @@ test if-10.6 {double invocation of variable traces} {
list [catch {if "$iftracevar + 20" {}} a] $a \
[catch {if "$iftracevar + 20" {}} b] $b \
[unset iftracevar iftracecounter]
-} {1 {syntax error in expression "1 oops 10 + 20"} 0 {} {}}
+} {1 {syntax error in expression "1 oops 10 + 20": extra tokens at end of expression} 0 {} {}}
# cleanup
::tcltest::cleanupTests
return
-
-
-
-
-
-
-
-
-
-
-
-