]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/expr-block.rs
Use different syntax for checks that matter to typestate
[rust.git] / src / test / run-pass / expr-block.rs
1 // xfail-boot
2 // -*- rust -*-
3
4 // Tests for standalone blocks as expressions
5
6 fn test_basic() {
7   let bool res = { true };
8   assert (res);
9 }
10
11 fn test_rec() {
12   auto res = { rec(v1 = 10, v2 = 20) };
13   assert (res.v2 == 20);
14 }
15
16 fn test_filled_with_stuff() {
17   auto res = {
18     auto a = 0;
19     while (a < 10) {
20       a += 1;
21     }
22     a
23   };
24   assert (res == 10);
25 }
26
27 fn main() {
28   test_basic();
29   test_rec();
30   test_filled_with_stuff();
31 }