Add an XFAILed test for treating alts as expressions
This commit is contained in:
parent
dcf04ffbad
commit
efb738153c
1 changed files with 31 additions and 0 deletions
31
src/test/run-pass/expr-alt.rs
Normal file
31
src/test/run-pass/expr-alt.rs
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
// xfail-boot
|
||||||
|
// xfail-stage0
|
||||||
|
// -*- rust -*-
|
||||||
|
|
||||||
|
// Tests for using alt as an expression
|
||||||
|
|
||||||
|
fn test() {
|
||||||
|
let bool res = alt (true) {
|
||||||
|
case (true) {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
case (false) {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
};
|
||||||
|
check (res);
|
||||||
|
|
||||||
|
res = alt(false) {
|
||||||
|
case (true) {
|
||||||
|
false
|
||||||
|
}
|
||||||
|
case (false) {
|
||||||
|
true
|
||||||
|
}
|
||||||
|
};
|
||||||
|
check (res);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
test();
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue