import "std/slice.zc" test "direct array iteration" { let arr: int[5] = [1, 2, 3, 4, 5]; let sum = 0; for val in arr { sum = sum + val; } assert(sum == 15, "Sum should be 1+2+3+4+5 = 15"); } test "direct array iteration with different types" { let floats: float[3] = [1.5, 2.5, 3.0]; let count = 0; for f in floats { count = count + 1; } assert(count == 3, "Should iterate over all 3 elements"); } // TODO: Nested array iteration needs special handling // test "nested array iteration" { // let matrix: int[2][3] = [[1, 2, 3], [4, 5, 6]]; // let total = 0; // // for row in matrix { // for val in row { // total = total + val; // } // } // // assert(total == 21, "Sum should be 1+2+3+4+5+6 = 21"); // }