summaryrefslogtreecommitdiffstats
path: root/tests/while-old.test
diff options
context:
space:
mode:
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}