2012-06-19 19:06:05 -05:00
|
|
|
fn main() {
|
|
|
|
let x = 2;
|
|
|
|
let x_message = alt x {
|
2012-07-14 00:57:48 -05:00
|
|
|
0 to 1 { ~"not many" }
|
|
|
|
_ { ~"lots" }
|
2012-06-19 19:06:05 -05:00
|
|
|
};
|
2012-07-14 00:57:48 -05:00
|
|
|
assert x_message == ~"lots";
|
2012-06-19 19:06:05 -05:00
|
|
|
|
|
|
|
let y = 2i;
|
|
|
|
let y_message = alt y {
|
2012-07-14 00:57:48 -05:00
|
|
|
0 to 1 { ~"not many" }
|
|
|
|
_ { ~"lots" }
|
2012-06-19 19:06:05 -05:00
|
|
|
};
|
2012-07-14 00:57:48 -05:00
|
|
|
assert y_message == ~"lots";
|
2012-06-19 19:06:05 -05:00
|
|
|
|
|
|
|
let z = 1u64;
|
|
|
|
let z_message = alt z {
|
2012-07-14 00:57:48 -05:00
|
|
|
0 to 1 { ~"not many" }
|
|
|
|
_ { ~"lots" }
|
2012-06-19 19:06:05 -05:00
|
|
|
};
|
2012-07-14 00:57:48 -05:00
|
|
|
assert z_message == ~"not many";
|
2012-06-19 19:06:05 -05:00
|
|
|
}
|