rust/src/test/run-pass/foreach-simple-outer-slot.rs

17 lines
301 B
Rust
Raw Normal View History

2010-06-23 23:03:09 -05:00
// -*- rust -*-
2010-06-23 23:03:09 -05:00
fn main() {
2011-07-27 07:19:39 -05:00
let sum: int = 0;
first_ten {|i| #debug("main"); log(debug, i); sum = sum + i; };
#debug("sum");
log(debug, sum);
assert (sum == 45);
2010-06-23 23:03:09 -05:00
}
fn first_ten(it: block(int)) {
2011-07-27 07:19:39 -05:00
let i: int = 0;
while i < 10 { #debug("first_ten"); it(i); i = i + 1; }
}