Reference the new platform test

Signed-off-by: Matthieu Pizenberg <matthieu.pizenberg@gmail.com>
This commit is contained in:
Matthieu Pizenberg 2025-12-04 18:55:50 +01:00
parent 6611e2f2f8
commit 27efb60b26
No known key found for this signature in database
GPG key ID: A167479D88D806B4

View file

@ -1538,3 +1538,16 @@ test "fx platform method inspect on string" {
// Should show MISSING METHOD error
try testing.expect(std.mem.indexOf(u8, run_result.stderr, "MISSING METHOD") != null);
}
test "fx platform if-expression closure capture regression" {
// Regression test: Variables bound inside an if-expression's block were
// incorrectly being captured as free variables by the enclosing lambda,
// causing a crash with "e_closure: failed to resolve capture value".
const allocator = testing.allocator;
const run_result = try runRoc(allocator, "test/fx/if-closure-capture.roc", .{});
defer allocator.free(run_result.stdout);
defer allocator.free(run_result.stderr);
try checkSuccess(run_result);
}