2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2014-03-05 17:28:08 -06:00
|
|
|
|
2015-03-22 15:13:15 -05:00
|
|
|
|
2011-05-13 13:42:23 -05:00
|
|
|
fn test_simple() {
|
2014-10-09 14:17:22 -05:00
|
|
|
let r = match true { true => { true } false => { panic!() } };
|
2013-05-18 21:02:45 -05:00
|
|
|
assert_eq!(r, true);
|
2011-05-13 13:42:23 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
fn test_box() {
|
2016-10-29 16:54:04 -05:00
|
|
|
let r = match true { true => { vec![10] } false => { panic!() } };
|
2015-01-25 15:05:03 -06:00
|
|
|
assert_eq!(r[0], 10);
|
2011-05-13 13:42:23 -05:00
|
|
|
}
|
|
|
|
|
2013-02-01 21:43:17 -06:00
|
|
|
pub fn main() { test_simple(); test_box(); }
|