mirror of
https://github.com/QwenLM/qwen-code.git
synced 2025-12-22 01:37:50 +00:00
feat(core): Cleanup after migrating tools. (#6199)
Co-authored-by: Jacob Richman <jacob314@gmail.com>
This commit is contained in:
@@ -395,7 +395,7 @@ describe('EditTool', () => {
|
||||
});
|
||||
});
|
||||
|
||||
it('should throw error if params are invalid', async () => {
|
||||
it('should throw error if file path is not absolute', async () => {
|
||||
const params: EditToolParams = {
|
||||
file_path: 'relative.txt',
|
||||
old_string: 'old',
|
||||
@@ -404,6 +404,17 @@ describe('EditTool', () => {
|
||||
expect(() => tool.build(params)).toThrow(/File path must be absolute/);
|
||||
});
|
||||
|
||||
it('should throw error if file path is empty', async () => {
|
||||
const params: EditToolParams = {
|
||||
file_path: '',
|
||||
old_string: 'old',
|
||||
new_string: 'new',
|
||||
};
|
||||
expect(() => tool.build(params)).toThrow(
|
||||
/The 'file_path' parameter must be non-empty./,
|
||||
);
|
||||
});
|
||||
|
||||
it('should edit an existing file and return diff with fileName', async () => {
|
||||
const initialContent = 'This is some old text.';
|
||||
const newContent = 'This is some new text.'; // old -> new
|
||||
|
||||
Reference in New Issue
Block a user