()
| 622 | // arr[1..4] is the half-open sub-slice {20, 30, 40}. 20 + 40 + 3 = 63. |
| 623 | assert_exit( |
| 624 | r#" |
| 625 | main: () -> i32 { |
| 626 | arr: i32[5] = [10, 20, 30, 40, 50] |
| 627 | view := arr[1..4] |
| 628 | return view[0] + view[2] + view.len as i32 |
| 629 | } |
| 630 | "#, |
| 631 | 63, |
| 632 | ); |
| 633 | } |
| 634 | |
| 635 | #[test] |
| 636 | fn range_slice_inclusive() { |
| 637 | // arr[1..=3] includes index 3, so {20, 30, 40}, same as arr[1..4]. |
| 638 | assert_exit( |
| 639 | r#" |
| 640 | main: () -> i32 { |
| 641 | arr: i32[5] = [10, 20, 30, 40, 50] |
nothing calls this directly
no test coverage detected