summaryrefslogtreecommitdiffstats
path: root/tests/while-old.test
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-30 13:27:52 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-10-30 13:27:52 (GMT)
commit076a7e2839881c03d0a98a8fc50823aef42ad79a (patch)
tree26698b0ef5c437526bbf0b1f88222dd4a0275d2a /tests/while-old.test
parent9efaa4d7f1aeb58c52fe41c62713b568a0833948 (diff)
downloadtcl-076a7e2839881c03d0a98a8fc50823aef42ad79a.zip
tcl-076a7e2839881c03d0a98a8fc50823aef42ad79a.tar.gz
tcl-076a7e2839881c03d0a98a8fc50823aef42ad79a.tar.bz2
Add "{}" around many "expr" commands in testcases. Also in doc/expr.n
Diffstat (limited to 'tests/while-old.test')
-rw-r--r--tests/while-old.test8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/while-old.test b/tests/while-old.test
index eddc025..f5315fb 100644
--- a/tests/while-old.test
+++ b/tests/while-old.test
@@ -20,7 +20,7 @@ if {"::tcltest" ni [namespace children]} {
test while-old-1.1 {basic while loops} {
set count 0
- while {$count < 10} {set count [expr $count+1]}
+ while {$count < 10} {set count [expr {$count + 1}]}
set count
} 10
test while-old-1.2 {basic while loops} {
@@ -58,9 +58,9 @@ test while-old-2.1 {continue in while loop} {
set index 0
set result {}
while {$index < 5} {
- if {$index == 2} {set index [expr $index+1]; continue}
+ if {$index == 2} {set index [expr {$index + 1}]; continue}
set result [concat $result [lindex $list $index]]
- set index [expr $index+1]
+ set index [expr {$index + 1}]
}
set result
} {1 2 4 5}
@@ -72,7 +72,7 @@ test while-old-3.1 {break in while loop} {
while {$index < 5} {
if {$index == 3} break
set result [concat $result [lindex $list $index]]
- set index [expr $index+1]
+ set index [expr {$index + 1}]
}
set result
} {1 2 3}