rust/src/test/run-pass/expr-alt-box.rs
2012-08-23 15:12:02 -07:00

19 lines
382 B
Rust

// -*- rust -*-
// Tests for match as expressions resulting in boxed types
fn test_box() {
let res = match true { true => { @100 } _ => fail ~"wat" };
assert (*res == 100);
}
fn test_str() {
let res = match true { true => { ~"happy" },
_ => fail ~"not happy at all" };
assert (res == ~"happy");
}
fn main() { test_box(); test_str(); }