expect help

new to expect
Can some one out there please send me an example of a counter.
example im running a test. test compleated 1, test compleat 2, test compleated 3. I have the test running in a loop but i want to keep track of the number of loops it has compleated. I have tryed looking in the exploring expect book. i have tryed incr count -1 >0 <0 nothing works
i tryed puts 'i got count is greater then zero
looked on google thats a joke

thanks a bunch

example of counter

#!/usr/bin/expect
set foo 0
while {$foo <= 5} {
incr foo
send "$foo"
}
return $foo