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