]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/expr-block.rs
Remove variable name 'res' from test suite
[rust.git] / src / test / run-pass / expr-block.rs
1
2
3
4 // -*- rust -*-
5
6 // Tests for standalone blocks as expressions
7 fn test_basic() { let bool rs = { true }; assert (rs); }
8
9 fn test_rec() { auto rs = { rec(v1=10, v2=20) }; assert (rs.v2 == 20); }
10
11 fn test_filled_with_stuff() {
12     auto rs = { auto a = 0; while (a < 10) { a += 1; } a };
13     assert (rs == 10);
14 }
15
16 fn main() { test_basic(); test_rec(); test_filled_with_stuff(); }