mirror of
https://github.com/roc-lang/roc.git
synced 2025-12-23 08:48:03 +00:00
Reference the new platform test
Signed-off-by: Matthieu Pizenberg <matthieu.pizenberg@gmail.com>
This commit is contained in:
parent
6611e2f2f8
commit
27efb60b26
1 changed files with 13 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue