rust/src/test/run-pass/expr-alt-box.rs
2011-07-27 15:54:33 +02:00

14 lines
286 B
Rust

// -*- rust -*-
// Tests for alt as expressions resulting in boxed types
fn test_box() { let res = alt true { true { @100 } }; assert (*res == 100); }
fn test_str() {
let res = alt true { true { "happy" } };
assert (res == "happy");
}
fn main() { test_box(); test_str(); }