Skip to content

Commit 87d23dd

Browse files
committed
---
yaml --- r: 1959 b: refs/heads/master c: c27b72e h: refs/heads/master i: 1957: ac5cc80 1955: fb5880c 1951: 4c138ff v: v3
1 parent 4432edc commit 87d23dd

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 19a949c15eb0a6179e62c6ac1a540ff15ede1a25
2+
refs/heads/master: c27b72e323d1aabb0eeb9939feb5584bc28ba9e9

trunk/src/test/run-pass/expr-block.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// xfail-boot
2+
// -*- rust -*-
3+
4+
// Tests for standalone blocks as expressions
5+
6+
fn test_basic() {
7+
let bool res = { true };
8+
check (res);
9+
}
10+
11+
fn test_rec() {
12+
auto res = { rec(v1 = 10, v2 = 20) };
13+
check (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+
check (res == 10);
25+
}
26+
27+
fn main() {
28+
test_basic();
29+
test_rec();
30+
test_filled_with_stuff();
31+
}

0 commit comments

Comments
 (0)