fix(artifacts): bound mobile projection candidates

This commit is contained in:
morluto
2026-07-20 11:31:36 +00:00
parent d36b385378
commit 0cc9d468c4
7 changed files with 109 additions and 20 deletions
+25
View File
@@ -0,0 +1,25 @@
import { describe, expect, it } from "vitest";
import { projectBoundedCartesian } from "../src/domain/boundedCartesianProjection.js";
describe("bounded Cartesian projection", () => {
it("stops projection work at the output limit", () => {
const values = Array.from({ length: 10_000 }, (_, index) => index);
let projections = 0;
const result = projectBoundedCartesian(values, values, 3, (left, right) => {
projections += 1;
return [left, right] as const;
});
expect(result).toEqual({
values: [
[0, 0],
[0, 1],
[0, 2],
],
omitted: 100_000_000 - 3,
});
expect(projections).toBe(3);
});
});