Skip to content

Commit 7714c76

Browse files
author
Bertan Ari
committed
test(vscode-lm): make inline code-span closure tests mutation-sensitive
The wider-backtick-run test placed the wrapper between the opener and the wider run, so its verdict was decided on a prefix ending before that run and no closure-rule mutation could change the outcome. Move the wider run ahead of the wrapper, and add a mixed wider/narrower run case plus a closed-span arming case so the span width tracking in insideInlineSpanAt is actually exercised.
1 parent 51ff888 commit 7714c76

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎src/api/providers/__tests__/vscode-lm.spec.ts‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1741,11 +1741,23 @@ describe("leaked tool-call parser contracts", () => {
17411741
})
17421742

17431743
it("does not close a double-backtick span with a wider backtick run", () => {
1744-
const text = [`Example: \`\`<function${"_calls"}>\`\`\` still quoted`, "", todo()].join("\n")
1744+
const text = [`Example: \`\`quoted \`\`\` <function${"_calls"}>\`\``, "", todo()].join("\n")
17451745

17461746
expect(callsOf(text)).toHaveLength(0)
17471747
})
17481748

1749+
it("does not close a double-backtick span with either a wider or a narrower backtick run", () => {
1750+
const text = [`Example: \`\`a \`\`\` b \` c <function${"_calls"}>\`\``, "", todo()].join("\n")
1751+
1752+
expect(callsOf(text)).toHaveLength(0)
1753+
})
1754+
1755+
it("arms on a wrapper opener that follows a closed double-backtick span", () => {
1756+
const text = [`Example: \`\`quoted\`\` then <function${"_calls"}>`, todo()].join("\n")
1757+
1758+
expect(callsOf(text)).toHaveLength(1)
1759+
})
1760+
17491761
it("still arms on a wrapper opener that is not inside any backtick span", () => {
17501762
expect(callsOf(wrap(todo()))).toHaveLength(1)
17511763
})

0 commit comments

Comments
 (0)