mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-23 11:34:44 -07:00
Fix dollar sign replacement bug in file editing (#7703)
This commit is contained in:
@@ -198,6 +198,22 @@ describe('EditTool', () => {
|
||||
'hello world',
|
||||
);
|
||||
});
|
||||
|
||||
it('should treat $ literally and not as replacement pattern', () => {
|
||||
const current = "price is $100 and pattern end is ' '";
|
||||
const oldStr = 'price is $100';
|
||||
const newStr = 'price is $200';
|
||||
const result = applyReplacement(current, oldStr, newStr, false);
|
||||
expect(result).toBe("price is $200 and pattern end is ' '");
|
||||
});
|
||||
|
||||
it("should treat $' literally and not as a replacement pattern", () => {
|
||||
const current = 'foo';
|
||||
const oldStr = 'foo';
|
||||
const newStr = "bar$'baz";
|
||||
const result = applyReplacement(current, oldStr, newStr, false);
|
||||
expect(result).toBe("bar$'baz");
|
||||
});
|
||||
});
|
||||
|
||||
describe('validateToolParams', () => {
|
||||
|
||||
Reference in New Issue
Block a user