rust/src/test/run-pass/expr-alt-box.rs
Brian Anderson 518dc52f85 Reformat
This changes the indexing syntax from .() to [], the vector syntax from ~[] to
[] and the extension syntax from #fmt() to #fmt[]
2011-08-20 11:04:00 -07:00

15 lines
287 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(); }