]> git.lizzy.rs Git - rust.git/blob - src/test/run-pass/expr-if-box.rs
Reformat source tree (minus a couple tests that are still grumpy).
[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     auto res = if (true) { @100 } else { @101 };
9     assert (*res == 100);
10 }
11
12 fn test_str() {
13     auto res = if (true) { "happy" } else { "sad" };
14     assert (res == "happy");
15 }
16
17 fn main() { test_box(); test_str(); }