diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-10-30 13:56:15 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2020-10-30 13:56:15 (GMT) |
commit | f163c24b4c9dd8b0e7c72274f1c008384ea8f514 (patch) | |
tree | 07e16057cf7afb1744e971639e8bd8359c9a3e9f /tests/for-old.test | |
parent | 076a7e2839881c03d0a98a8fc50823aef42ad79a (diff) | |
download | tcl-f163c24b4c9dd8b0e7c72274f1c008384ea8f514.zip tcl-f163c24b4c9dd8b0e7c72274f1c008384ea8f514.tar.gz tcl-f163c24b4c9dd8b0e7c72274f1c008384ea8f514.tar.bz2 |
Simplify testcases using "incr"
Diffstat (limited to 'tests/for-old.test')
-rw-r--r-- | tests/for-old.test | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/for-old.test b/tests/for-old.test index d68f05a..baf40fa 100644 --- a/tests/for-old.test +++ b/tests/for-old.test @@ -22,14 +22,14 @@ if {"::tcltest" ni [namespace children]} { catch {unset a i} test for-old-1.1 {for tests} { set a {} - for {set i 1} {$i<6} {set i [expr {$i+1}]} { + for {set i 1} {$i<6} {incr i} { set a [concat $a $i] } set a } {1 2 3 4 5} test for-old-1.2 {for tests} { set a {} - for {set i 1} {$i<6} {set i [expr {$i+1}]} { + for {set i 1} {$i<6} {incr i} { if {$i==4} continue set a [concat $a $i] } @@ -37,7 +37,7 @@ test for-old-1.2 {for tests} { } {1 2 3 5} test for-old-1.3 {for tests} { set a {} - for {set i 1} {$i<6} {set i [expr {$i+1}]} { + for {set i 1} {$i<6} {incr i} { if {$i==4} break set a [concat $a $i] } @@ -55,12 +55,12 @@ test for-old-1.7 {for tests} { } {wrong # args: should be "for start test next command"} test for-old-1.8 {for tests} { set a {xyz} - for {set i 1} {$i<6} {set i [expr {$i+1}]} {} + for {set i 1} {$i<6} {incr i} {} set a } xyz test for-old-1.9 {for tests} { set a {} - for {set i 1} {$i<6} {set i [expr {$i+1}]; if {$i==4} break} { + for {set i 1} {$i<6} {incr i; if {$i==4} break} { set a [concat $a $i] } set a |