From 282ff394dd3be516e70307228355c062e12296e3 Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Tue, 10 Feb 2026 01:33:51 +0000 Subject: [PATCH] Cover plus-prefixed port rejection cases Co-authored-by: Theo Browne --- apps/t3/src/cli.test.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/apps/t3/src/cli.test.ts b/apps/t3/src/cli.test.ts index 09b43d5e65..f736301b7f 100644 --- a/apps/t3/src/cli.test.ts +++ b/apps/t3/src/cli.test.ts @@ -230,6 +230,12 @@ describe("parseCliOptions", () => { ); }); + it("rejects plus-prefixed explicit port values", () => { + expect(() => parseCliOptions(["--web-port", "+4318"], {}, "/workspace")).toThrow( + "Invalid value for --web-port", + ); + }); + it("throws for out-of-range explicit port values", () => { expect(() => parseCliOptions(["--backend-port", "65536"], {}, "/workspace")).toThrow( "Invalid value for --backend-port", @@ -296,6 +302,12 @@ describe("parseCliOptions", () => { ); }); + it("rejects plus-prefixed environment port values", () => { + expect(() => parseCliOptions([], { T3_BACKEND_PORT: "+4317" }, "/workspace")).toThrow( + "Invalid value for T3_BACKEND_PORT", + ); + }); + it("throws for empty environment port values", () => { expect(() => parseCliOptions([], { T3_WEB_PORT: "" }, "/workspace")).toThrow( "Invalid value for T3_WEB_PORT",