()
| 340 | while i < 5 { |
| 341 | i = i + 1 |
| 342 | } |
| 343 | return i |
| 344 | }"#; |
| 345 | assert!(has_terminator(source, |t| matches!( |
| 346 | t, |
| 347 | IrTerminator::Jump(..) |
| 348 | ))); |
| 349 | } |
| 350 | |
| 351 | #[test] |
| 352 | fn if_without_else_still_compiles() { |
| 353 | let source = r#"main: () -> i32 { |
| 354 | x: i32 = 1 |
nothing calls this directly
no test coverage detected