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

12 lines
242 B
Rust
Raw Normal View History

2011-05-13 13:42:23 -05:00
fn test_simple() {
2011-07-27 07:19:39 -05:00
let r = alt true { true { true } false { fail } };
assert (r == true);
2011-05-13 13:42:23 -05:00
}
fn test_box() {
let r = alt true { true { ~[10] } false { fail } };
assert (r[0] == 10);
2011-05-13 13:42:23 -05:00
}
fn main() { test_simple(); test_box(); }