Skip to content

Commit efb7381

Browse files
committed
Add an XFAILed test for treating alts as expressions
1 parent dcf04ff commit efb7381

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

src/test/run-pass/expr-alt.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
// xfail-boot
2+
// xfail-stage0
3+
// -*- rust -*-
4+
5+
// Tests for using alt as an expression
6+
7+
fn test() {
8+
let bool res = alt (true) {
9+
case (true) {
10+
true
11+
}
12+
case (false) {
13+
false
14+
}
15+
};
16+
check (res);
17+
18+
res = alt(false) {
19+
case (true) {
20+
false
21+
}
22+
case (false) {
23+
true
24+
}
25+
};
26+
check (res);
27+
}
28+
29+
fn main() {
30+
test();
31+
}

0 commit comments

Comments
 (0)