()
| 1449 | fn match_integer_literal_falls_to_catch_all() { |
| 1450 | assert_exit( |
| 1451 | r#" |
| 1452 | main: () -> i32 { |
| 1453 | n: i32 = 7 |
| 1454 | match n { |
| 1455 | 1 -> { |
| 1456 | return 1 |
| 1457 | } |
| 1458 | 2 -> { |
| 1459 | return 2 |
| 1460 | } |
| 1461 | _ -> { |
| 1462 | return 42 |
| 1463 | } |
| 1464 | } |
| 1465 | return -1 |
| 1466 | } |
| 1467 | "#, |
| 1468 | 42, |
| 1469 | ); |
| 1470 | } |
| 1471 | |
| 1472 | #[test] |
| 1473 | fn match_char_literal_dispatch() { |
| 1474 | // Char literals compare as their ascii byte; 'b' takes the second arm. |
| 1475 | assert_exit( |
| 1476 | r#" |
| 1477 | main: () -> i32 { |
| 1478 | c: i32 = 'b' |
| 1479 | x: i32 = match c { |
nothing calls this directly
no test coverage detected