test: overhaul deterministic suite architecture

This commit is contained in:
morluto
2026-07-29 22:00:38 +00:00
parent 7f2348619a
commit 513d9b1555
371 changed files with 30879 additions and 24389 deletions
@@ -0,0 +1,25 @@
import { describe, expect, it } from "vitest";
import { projectBoundedCartesian } from "./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);
});
});