Skip to content

Commit

Permalink
Test empty vector comprehension
Browse files Browse the repository at this point in the history
  • Loading branch information
samestep committed Sep 23, 2023
1 parent 1070402 commit f3880b4
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions packages/core/src/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -722,4 +722,18 @@ describe("valid", () => {
const h = await compile(g);
expect(h(2, 3, 5, 7)).toBe(30);
});

test("compile empty vector comprehension", async () => {
let i = 0;
const f = opaque([], Real, () => {
++i;
return i;
});
const g = fn([], Real, () => {
vec(0, Real, () => f());
return 0;
});
(await compile(g))();
expect(i).toEqual(0);
});
});

0 comments on commit f3880b4

Please sign in to comment.