mirror of
https://github.com/morluto/rea
synced 2026-10-26 14:25:49 -04:00
27 lines
909 B
TypeScript
27 lines
909 B
TypeScript
import { expect, it } from "vitest";
|
|
import { analyzeJavaScriptSemantics } from "./javascriptSemanticAnalysis.js";
|
|
import { topLevelBinding } from "./javascriptSemanticAnalysis.fixture.js";
|
|
|
|
it("retains a provenance-only depth limit in canonical file coverage", () => {
|
|
const analyze = (count: number) =>
|
|
analyzeJavaScriptSemantics(
|
|
`const deep=${"a=".repeat(count)}"x"; const stable=7;`,
|
|
);
|
|
const shallow = analyze(10);
|
|
const deep = analyze(300);
|
|
expect(shallow.coverage.status).toBe("complete");
|
|
expect(deep.coverage).toMatchObject({
|
|
status: "partial",
|
|
omittedCount: null,
|
|
resourceLimits: ["expression-depth"],
|
|
});
|
|
expect(topLevelBinding(deep, "deep").provenance).toMatchObject({
|
|
status: "unknown",
|
|
reason: expect.stringContaining("depth budget"),
|
|
});
|
|
expect(topLevelBinding(deep, "stable").value).toEqual({
|
|
status: "literal",
|
|
value: 7,
|
|
});
|
|
});
|