summaryrefslogtreecommitdiffstats
path: root/tests/parse.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2021-01-28 10:42:05 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2021-01-28 10:42:05 (GMT)
commit8d49123e73e1b0bbbf97cd212e88960772a9e166 (patch)
treeb3753c3b36bfe5b8fb3203da20f2864e9981ea97 /tests/parse.test
parent9c024d9d3bfcd6cee7c0a39492f7e1fd4f80192d (diff)
downloadtcl-8d49123e73e1b0bbbf97cd212e88960772a9e166.zip
tcl-8d49123e73e1b0bbbf97cd212e88960772a9e166.tar.gz
tcl-8d49123e73e1b0bbbf97cd212e88960772a9e166.tar.bz2
Use {} braces in more "expr" expressions.
Diffstat (limited to 'tests/parse.test')
-rw-r--r--tests/parse.test18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/parse.test b/tests/parse.test
index 4370acb..39f3d1e 100644
--- a/tests/parse.test
+++ b/tests/parse.test
@@ -278,7 +278,7 @@ test parse-6.9 {ParseTokens procedure, error in command substitution} {
} {0}
test parse-6.10 {ParseTokens procedure, incomplete sub-command} {
info complete {puts [
- expr 1+1
+ expr {1+1}
#this is a comment ]}
} {0}
test parse-6.11 {ParseTokens procedure, memory allocation for big nested command} testparser {
@@ -485,7 +485,7 @@ test parse-10.3 {Tcl_EvalTokens, nested commands} testevalex {
} {8}
test parse-10.4 {Tcl_EvalTokens, nested commands} testevalex {
unset -nocomplain a
- list [catch {testevalex {concat xxx[expr $a]}} msg] $msg
+ list [catch {testevalex {concat xxx[expr {$a}]}} msg] $msg
} {1 {can't read "a": no such variable}}
test parse-10.5 {Tcl_EvalTokens, simple variables} testevalex {
set a hello
@@ -518,7 +518,7 @@ test parse-10.11 {Tcl_EvalTokens, object values} testevalex {
testevalex {concat $a$a$a}
} {123123123}
test parse-10.12 {Tcl_EvalTokens, object values} testevalex {
- testevalex {concat [expr 2][expr 4][expr 6]}
+ testevalex {concat [expr {2}][expr {4}][expr {6}]}
} {246}
test parse-10.13 {Tcl_EvalTokens, string values} testevalex {
testevalex {concat {a" b"}}
@@ -984,26 +984,26 @@ test parse-18.14 {Tcl_SubstObj, exception handling} {
subst {abc,[break],def}
} {abc,}
test parse-18.15 {Tcl_SubstObj, exception handling} {
- subst {abc,[continue; expr 1+2],def}
+ subst {abc,[continue; expr {1+2}],def}
} {abc,,def}
test parse-18.16 {Tcl_SubstObj, exception handling} {
- subst {abc,[return foo; expr 1+2],def}
+ subst {abc,[return foo; expr {1+2}],def}
} {abc,foo,def}
test parse-18.17 {Tcl_SubstObj, exception handling} {
- subst {abc,[return -code 10 foo; expr 1+2],def}
+ subst {abc,[return -code 10 foo; expr {1+2}],def}
} {abc,foo,def}
test parse-18.18 {Tcl_SubstObj, exception handling} {
subst {abc,[break; set {} {}{}],def}
} {abc,}
test parse-18.19 {Tcl_SubstObj, exception handling} {
- list [catch {subst {abc,[continue; expr 1+2; set {} {}{}],def}} msg] $msg
+ list [catch {subst {abc,[continue; expr {1+2}; set {} {}{}],def}} msg] $msg
} [list 1 "extra characters after close-brace"]
test parse-18.20 {Tcl_SubstObj, exception handling} {
- list [catch {subst {abc,[return foo; expr 1+2; set {} {}{}],def}} msg] $msg
+ list [catch {subst {abc,[return foo; expr {1+2}; set {} {}{}],def}} msg] $msg
} [list 1 "extra characters after close-brace"]
test parse-18.21 {Tcl_SubstObj, exception handling} {
list [catch {
- subst {abc,[return -code 10 foo; expr 1+2; set {} {}{}],def}
+ subst {abc,[return -code 10 foo; expr {1+2}; set {} {}{}],def}
} msg] $msg
} [list 1 "extra characters after close-brace"]