blob: 84c9e424f4698ccbf64a53aab55ece7c041e46bb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
|
// -*- 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(); }
|