Skip to content

Commit d3dff49

Browse files
committed
fix(test): use smart quotes in newText to preserve original form
The fuzzy match consumes the smart quotes from the original, so newText must provide the desired output form. This correctly tests that the NFKC offset mapper preserves unrelated content (ligature + combining accent).
1 parent 5e98775 commit d3dff49

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/agents/sessions/tools/edit-diff.test.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,10 +186,12 @@ describe("applyEditsToNormalizedContent", () => {
186186

187187
const result = applyEditsToNormalizedContent(
188188
normalizeToLF(line),
189-
[{ oldText: "'X'", newText: "'Y'" }],
189+
[{ oldText: "'X'", newText: "\u2018Y\u2019" }],
190190
"test.ts",
191191
);
192192
// After mapping the NFKC match back to original offsets, fi and e+acute must be preserved.
193+
// The smart quotes are restored because the match consumed them and newText provides
194+
// the smart-quote form.
193195
expect(result.newContent).toBe("\uFB01 \u2018Y\u2019 e\u0301");
194196
});
195197

0 commit comments

Comments
 (0)