test(ttsr): cover human-readable inference note

(cherry picked from commit 8867610c39cf302089b7a4203e3ff8886fb1af52)
This commit is contained in:
can1357
2026-07-29 22:46:45 +02:00
parent ab48f43783
commit 8e72d4778e
@@ -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)"]);