PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 2ms RepoModel.GetById 1ms app.codeStats 0ms

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

http://github.com/jruderman/rust
Rust | 17 lines | 9 code | 6 blank | 2 comment | 2 complexity | 77410e421016dbf0dd6be55fd6666390 MD5 | raw file
 1
 2
 3
 4// -*- rust -*-
 5
 6// Tests for match as expressions resulting in boxed types
 7fn test_box() {
 8    let res = match check true { true => { @100 } };
 9    assert (*res == 100);
10}
11
12fn test_str() {
13    let res = match check true { true => { ~"happy" } };
14    assert (res == ~"happy");
15}
16
17fn main() { test_box(); test_str(); }