summaryrefslogtreecommitdiff
path: root/packages/core/src/tools/edit.test.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/core/src/tools/edit.test.ts')
-rw-r--r--packages/core/src/tools/edit.test.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/core/src/tools/edit.test.ts b/packages/core/src/tools/edit.test.ts
index 84ad1daf..4ff33ff4 100644
--- a/packages/core/src/tools/edit.test.ts
+++ b/packages/core/src/tools/edit.test.ts
@@ -608,6 +608,19 @@ describe('EditTool', () => {
/User modified the `new_string` content/,
);
});
+
+ it('should return error if old_string and new_string are identical', async () => {
+ const initialContent = 'This is some identical text.';
+ fs.writeFileSync(filePath, initialContent, 'utf8');
+ const params: EditToolParams = {
+ file_path: filePath,
+ old_string: 'identical',
+ new_string: 'identical',
+ };
+ const result = await tool.execute(params, new AbortController().signal);
+ expect(result.llmContent).toMatch(/No changes to apply/);
+ expect(result.returnDisplay).toMatch(/No changes to apply/);
+ });
});
describe('getDescription', () => {