2011-05-13 13:42:23 -05:00
|
|
|
fn test_simple() {
|
2011-07-27 07:19:39 -05:00
|
|
|
let r = alt true { true { true } false { fail } };
|
2011-06-15 13:19:50 -05:00
|
|
|
assert (r == true);
|
2011-05-13 13:42:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn test_box() {
|
2012-06-25 22:00:46 -05:00
|
|
|
let r = alt true { true { [10]/~ } false { fail } };
|
2011-08-19 17:16:48 -05:00
|
|
|
assert (r[0] == 10);
|
2011-05-13 13:42:23 -05:00
|
|
|
}
|
|
|
|
|
2011-08-19 17:16:48 -05:00
|
|
|
fn main() { test_simple(); test_box(); }
|