From d96f0380aaa7e304dd0aafe050a9df324b10d0a5 Mon Sep 17 00:00:00 2001 From: morluto <76467478+morluto@users.noreply.github.com> Date: Wed, 18 Nov 2026 22:15:24 +0800 Subject: [PATCH] test(cli): verify the advertised outline-depth range (#12061) --- .../boundary/cli/cliInputSchemaRequired.test.ts | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/tests/boundary/cli/cliInputSchemaRequired.test.ts b/tests/boundary/cli/cliInputSchemaRequired.test.ts index c1311ebbe7..8a5cda8655 100644 --- a/tests/boundary/cli/cliInputSchemaRequired.test.ts +++ b/tests/boundary/cli/cliInputSchemaRequired.test.ts @@ -776,8 +776,8 @@ describe("reference-source outline-depth input schema", () => { const outlineDepth = advertised.options?.properties?.outlineDepth; expect(outlineDepth).toMatchObject({ anyOf: [ - { type: "integer", minimum: 0 }, - { type: "string", pattern: "^[0-9]+$" }, + { type: "integer", minimum: 0, maximum: Number.MAX_SAFE_INTEGER }, + { type: "string", pattern: expect.any(String) }, ], }); @@ -827,8 +827,16 @@ describe("reference-source outline-depth input schema", () => { expect(validate(parsed.data)).toBe(true); expect(validate({ outlineDepth: token, detail: "summary" })).toBe(true); } - for (const token of ["0x2", "2e0", "-1"]) - expect(validate({ outlineDepth: token, detail: "summary" })).toBe(false); + for (const token of [ + "0x2", + "2e0", + "-1", + "9007199254740992", + "09007199254740992", + ]) + expect(validate({ outlineDepth: token, detail: "summary" }), token).toBe( + false, + ); expect(validate({ outlineDepth: -1 })).toBe(false); expect(validate({ outlineDepth: 9007199254740992 })).toBe(false); expect(validate({ outlineDepth: 2 })).toBe(false);