()
| 235 | |
| 236 | // --- `for` over ranges (lowers to `while`) --- |
| 237 | |
| 238 | #[test] |
| 239 | fn for_range_sums() { |
| 240 | // Half-open `0..5` iterates 0,1,2,3,4 -> sum 10. |
| 241 | assert_exit( |
| 242 | r#" |
| 243 | main: () -> 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 |
nothing calls this directly
no test coverage detected