yinwm
35fa64cde8
feat: US-015 - Add EditTool tests
Added comprehensive test coverage for EditTool (EditFileTool, AppendFileTool) with 10 test cases:
- TestEditTool_EditFile_Success: Verifies successful file editing
- TestEditTool_EditFile_NotFound: Verifies error handling for non-existent files
- TestEditTool_EditFile_OldTextNotFound: Verifies error when old_text not found
- TestEditTool_EditFile_MultipleMatches: Verifies error for multiple occurrences
- TestEditTool_EditFile_OutsideAllowedDir: Verifies directory restriction
- TestEditTool_EditFile_MissingPath: Verifies missing path parameter
- TestEditTool_EditFile_MissingOldText: Verifies missing old_text parameter
- TestEditTool_EditFile_MissingNewText: Verifies missing new_text parameter
- TestEditTool_AppendFile_Success: Verifies successful file appending
- TestEditTool_AppendFile_MissingPath: Verifies missing path for append
- TestEditTool_AppendFile_MissingContent: Verifies missing content for append
EditTool implementation already conforms to ToolResult specification:
- EditFile returns SilentResult('File edited: ...')
- AppendFile returns SilentResult('Appended to ...')
- Errors return ErrorResult with IsError=true
EditFileTool includes security feature: optional directory restriction to prevent editing files outside allowed paths.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 19:55:57 +08:00
..
2026-02-12 19:49:36 +08:00
2026-02-11 11:41:13 -06:00
2026-02-09 19:20:19 +08:00
2026-02-12 12:46:28 +08:00
2026-02-12 11:59:05 +08:00
2026-02-11 20:31:41 +08:00
2026-02-12 19:39:57 +08:00
2026-02-09 19:20:19 +08:00
2026-02-11 12:48:16 -06:00
2026-02-11 13:39:19 -06:00
2026-02-11 20:31:41 +08:00
2026-02-11 00:14:33 +08:00
2026-02-12 19:46:10 +08:00
2026-02-12 19:55:57 +08:00
2026-02-12 12:46:28 +08:00
2026-02-12 00:46:48 +08:00