()
| 809 | #[test] |
| 810 | fn hll_function_call_and_return() { |
| 811 | let (_, outcome, _) = run_hll( |
| 812 | r#" |
| 813 | add: (a: i32, b: i32) -> i32 { |
| 814 | return a + b |
| 815 | } |
| 816 | main: () -> i32 { |
| 817 | return add(10, 32) |
| 818 | } |
| 819 | "#, |
| 820 | ); |
| 821 | assert!( |
| 822 | matches!(outcome, StepOutcome::Halted(42)), |
| 823 | "expected Halted(42), got {outcome:?}" |
| 824 | ); |
| 825 | } |
| 826 | |
| 827 | #[test] |
| 828 | fn hll_putchar_output() { |
| 829 | let (_, outcome, uart) = run_hll( |
| 830 | r#" |
| 831 | console := import("console") |
| 832 | |
| 833 | main: () -> i32 { |
| 834 | console.putchar(65) |
| 835 | console.putchar(66) |
| 836 | console.putchar(67) |
nothing calls this directly
no test coverage detected