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