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

Function for_range_sums

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

Source from the content-addressed store, hash-verified

235
236// --- `for` over ranges (lowers to `while`) ---
237
238#[test]
239fn for_range_sums() {
240 // Half-open `0..5` iterates 0,1,2,3,4 -> sum 10.
241 assert_exit(
242 r#"
243main: () -> i32 {
244 total: i32 = 0
245 for i in 0..5 {
246 total = total + i
247 }
248 return total
249}
250"#,
251 10,
252 );
253}
254

Callers

nothing calls this directly

Calls 1

assert_exitFunction · 0.85

Tested by

no test coverage detected