MCPcopy Create free account
hub / github.com/LPC4/Full-Stack / range_slice_of_slice

Function range_slice_of_slice

tests/integration/hll_conformance.rs:624–638  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

622 // arr[1..4] is the half-open sub-slice {20, 30, 40}. 20 + 40 + 3 = 63.
623 assert_exit(
624 r#"
625main: () -> 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]
636fn range_slice_inclusive() {
637 // arr[1..=3] includes index 3, so {20, 30, 40}, same as arr[1..4].
638 assert_exit(
639 r#"
640main: () -> i32 {
641 arr: i32[5] = [10, 20, 30, 40, 50]

Callers

nothing calls this directly

Calls 1

assert_exitFunction · 0.85

Tested by

no test coverage detected