2018-08-30 12:18:55 +00:00
|
|
|
// run-pass
|
2015-03-22 20:13:15 +00:00
|
|
|
|
2013-02-02 03:43:17 +00:00
|
|
|
pub fn main() {
|
2015-01-25 21:05:03 +00:00
|
|
|
let x = 2;
|
2012-08-06 19:34:08 +00:00
|
|
|
let x_message = match x {
|
2018-05-29 02:42:11 +00:00
|
|
|
0 ..= 1 => { "not many".to_string() }
|
2014-05-25 10:10:11 +00:00
|
|
|
_ => { "lots".to_string() }
|
2012-06-20 00:06:05 +00:00
|
|
|
};
|
2014-05-25 10:10:11 +00:00
|
|
|
assert_eq!(x_message, "lots".to_string());
|
2012-06-20 00:06:05 +00:00
|
|
|
|
2015-01-25 21:05:03 +00:00
|
|
|
let y = 2;
|
2012-08-06 19:34:08 +00:00
|
|
|
let y_message = match y {
|
2018-05-29 02:42:11 +00:00
|
|
|
0 ..= 1 => { "not many".to_string() }
|
2014-05-25 10:10:11 +00:00
|
|
|
_ => { "lots".to_string() }
|
2012-06-20 00:06:05 +00:00
|
|
|
};
|
2014-05-25 10:10:11 +00:00
|
|
|
assert_eq!(y_message, "lots".to_string());
|
2012-06-20 00:06:05 +00:00
|
|
|
|
|
|
|
let z = 1u64;
|
2012-08-06 19:34:08 +00:00
|
|
|
let z_message = match z {
|
2018-05-29 02:42:11 +00:00
|
|
|
0 ..= 1 => { "not many".to_string() }
|
2014-05-25 10:10:11 +00:00
|
|
|
_ => { "lots".to_string() }
|
2012-06-20 00:06:05 +00:00
|
|
|
};
|
2014-05-25 10:10:11 +00:00
|
|
|
assert_eq!(z_message, "not many".to_string());
|
2012-06-20 00:06:05 +00:00
|
|
|
}
|