]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/expr-if-box.rs
Move the world over to using the new style string literals and types. Closes #2907.
[rust.git] / src / test / run-pass / expr-if-box.rs
1
2
3
4 // -*- rust -*-
5
6 // Tests for if as expressions returning boxed types
7 fn test_box() {
8     let rs = if true { @100 } else { @101 };
9     assert (*rs == 100);
10 }
11
12 fn test_str() {
13     let rs = if true { ~"happy" } else { ~"sad" };
14     assert (rs == ~"happy");
15 }
16
17 fn main() { test_box(); test_str(); }