From 8e72d4778e5b37f659cd9fed1fb03095f4bcfa36 Mon Sep 17 00:00:00 2001 From: can1357 Date: Wed, 29 Jul 2026 22:46:45 +0200 Subject: [PATCH] test(ttsr): cover human-readable inference note (cherry picked from commit 8867610c39cf302089b7a4203e3ff8886fb1af52) --- packages/coding-agent/test/cli/ttsr-cli.test.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/packages/coding-agent/test/cli/ttsr-cli.test.ts b/packages/coding-agent/test/cli/ttsr-cli.test.ts index 0d34452fd..a51fdc95d 100644 --- a/packages/coding-agent/test/cli/ttsr-cli.test.ts +++ b/packages/coding-agent/test/cli/ttsr-cli.test.ts @@ -210,6 +210,15 @@ describe("omp ttsr", () => { expect(report.triggered).toHaveLength(0); }); + it("renders the inferred text-source note in human-readable output", async () => { + captureStreams(); + const rulePath = await writeTempRule("class", ["tool:edit(*.cs)"]); + const snippetPath = await writeTempSnippet("class A {}", "unknownext"); + await run({ action: "test", test: { rule: rulePath, file: snippetPath, source: undefined } }); + expect(stdout).toContain("note: inferred --source text from '.unknownext'"); + expect(stdout).toContain("--source tool --tool edit"); + }); + it("omits the inference note when --source is explicit", async () => { captureStreams(); const rulePath = await writeTempRule("class", ["tool:edit(*.cs)"]);