Skip to content

Commit 882d35b

Browse files
sahrizviclaude
andcommitted
test: point the stdin source assertion at the bounded read
Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_011chv9Rmu7jQXokum1WNcs7
1 parent 6551112 commit 882d35b

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

‎packages/opencode/test/release-validation/question-937-codex.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -345,10 +345,10 @@ describe("release validation PR #937 source-level env plumbing", () => {
345345
expect(source).not.toContain('process.env["ALTIMATE_NON_INTERACTIVE"] === undefined')
346346
})
347347

348-
test("run command guards Bun.stdin.text() behind an existing non-TTY stdin", async () => {
348+
test("run command guards the stdin read behind an existing non-TTY stdin", async () => {
349349
const source = await Bun.file(new URL("../../src/cli/cmd/run.ts", import.meta.url)).text()
350350

351-
expect(source).toContain("if (process.stdin && !process.stdin.isTTY) message +=")
351+
expect(source).toContain("if (process.stdin && !process.stdin.isTTY) {\n const { readRunStdin, STDIN_WAIT_MS }")
352352
expect(source).not.toContain("if (!process.stdin?.isTTY)")
353353
})
354354

‎packages/opencode/test/release-validation/question-937.test.ts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,8 +386,8 @@ describe("run.ts ALTIMATE_NON_INTERACTIVE guard contract", () => {
386386
// ---------------------------------------------------------------------------
387387
// Gap #9 — null-safe stdin read does not stall when process.stdin is undefined.
388388
//
389-
// The guard is inline in src/cli/cmd/run.ts:463 and not exported:
390-
// if (process.stdin && !process.stdin.isTTY) message += "\n" + (await Bun.stdin.text())
389+
// The guard is inline in src/cli/cmd/run.ts and not exported:
390+
// if (process.stdin && !process.stdin.isTTY) { ... await readRunStdin() ... }
391391
// Helper mirrors that predicate and the append behavior so the regression
392392
// (undefined stdin satisfied `!stdin?.isTTY` and stalled awaiting EOF) is
393393
// locked: undefined stdin must NOT trigger the read.

0 commit comments

Comments
 (0)