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

Function for_each_array_sums

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

Source from the content-addressed store, hash-verified

351
352// --- `for` over a fixed array ---
353
354#[test]
355fn for_each_array_sums() {
356 // `for x in arr` binds each element by value: 3 + 5 + 7 + 9 = 24.
357 assert_exit(
358 r#"
359main: () -> i32 {
360 arr: i32[4] = [3, 5, 7, 9]
361 total: i32 = 0
362 for x in arr {
363 total = total + x
364 }
365 return total
366}
367"#,
368 24,
369 );
370}
371

Callers

nothing calls this directly

Calls 1

assert_exitFunction · 0.85

Tested by

no test coverage detected