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

Function li_boundary_2048

tests/integration/vm_execution.rs:1302–1318  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1300 return 0
1301}
1302"#,
1303 );
1304 assert!(
1305 matches!(outcome, RunOutcome::Halted(0)),
1306 "struct fn-pointer field call should pass, got {outcome:?}"
1307 );
1308}
1309
1310/// An indexed function-pointer element is callable directly: `table[i](args)`.
1311#[test]
1312fn indexed_function_pointer_call() {
1313 let (_, outcome, _) = run_hll(
1314 r#"
1315type BinaryOp = (i32, i32) -> i32
1316add: (a: i32, b: i32) -> i32 { return a + b }
1317mul: (a: i32, b: i32) -> i32 { return a * b }
1318main: () -> i32 {
1319 ops: BinaryOp[2] = [add, mul]
1320 if ops[0](40, 2) != 42 { return 1 }
1321 if ops[1](6, 7) != 42 { return 2 }

Callers

nothing calls this directly

Calls 1

run_hllFunction · 0.70

Tested by

no test coverage detected