History

Read stdin before validating required image flag in codex test stub

- Move stdin capture earlier in fake codex script setup - Ensure stdin-based assertions remain available even when image validation fails

Julius Marminge committed 8 months ago

Commit 596e1591 parent 70c91471 file · +1 −1Browse files

Unified · Split

apps/server/src/git/Layers/CodexTextGeneration.test.ts+1−1
@@ -41,11 +41,11 @@ function makeFakeCodexBinary(dir: string) { · 40 unmodified lines
4141 " fi",
4242 " shift",
4343 "done",
44+ 'stdin_content="$(cat)"',
4445 'if [ "$T3_FAKE_CODEX_REQUIRE_IMAGE" = "1" ] && [ "$seen_image" != "1" ]; then',
4546 ' printf "%s\\n" "missing --image input" >&2',
4647 " exit 2",
4748 "fi",
48− 'stdin_content="$(cat)"',
4949 'if [ -n "$T3_FAKE_CODEX_STDIN_MUST_CONTAIN" ]; then',
5050 ' printf "%s" "$stdin_content" | grep -F -- "$T3_FAKE_CODEX_STDIN_MUST_CONTAIN" >/dev/null || {',
5151 ' printf "%s\\n" "stdin missing expected content" >&2',