/src/test/run-pass/expr-alt-box.rs

http://github.com/jruderman/rust · Rust · 17 lines · 9 code · 6 blank · 2 comment · 4 complexity · 77410e421016dbf0dd6be55fd6666390 MD5 · raw file

  1. // -*- rust -*-
  2. // Tests for match as expressions resulting in boxed types
  3. fn test_box() {
  4. let res = match check true { true => { @100 } };
  5. assert (*res == 100);
  6. }
  7. fn test_str() {
  8. let res = match check true { true => { ~"happy" } };
  9. assert (res == ~"happy");
  10. }
  11. fn main() { test_box(); test_str(); }