Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/github-completion-host.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ describe("completion integration generation cap (#1384)", () => {
}
});

it("port generation guard admits I4 and I5 and rejects I6", () => {
assert.equal(parseCompletionGeneration(4), 4);
assert.equal(parseCompletionGeneration(5), 5);
for (const value of [0, 6, null, "4"]) {
it("port generation guard accepts absolute I6 and later in a resumed five-generation run", () => {
for (const generation of [4, 5, 6, 7, 12, Number.MAX_SAFE_INTEGER]) {
assert.equal(parseCompletionGeneration(generation), generation);
}
for (const value of [0, -1, 1.5, null, "6", Number.MAX_SAFE_INTEGER + 1]) {
assert.throws(() => parseCompletionGeneration(value), /generation_INVALID/);
}
});
Expand Down
2 changes: 1 addition & 1 deletion src/github-completion-host.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function positiveInt(value: unknown, name: string, maximum: number): number {
}

export function parseCompletionGeneration(value: unknown): number {
return positiveInt(value, "generation", MAX_COMPLETION_INTEGRATION_GENERATIONS);
return positiveInt(value, "generation", Number.MAX_SAFE_INTEGER);
}

export function isTransientRequiredChecksDecision(
Expand Down
Loading