MCPcopy Create free account
hub / github.com/AI45Lab/Code / test_edit_not_found

Function test_edit_not_found

core/src/tools/builtin/edit.rs:241–262  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

239
240 #[tokio::test]
241 async fn test_edit_not_found() {
242 let temp = tempfile::tempdir().unwrap();
243 std::fs::write(temp.path().join("test.txt"), "hello world").unwrap();
244
245 let tool = EditTool;
246 let ctx = ToolContext::new(temp.path().to_path_buf());
247
248 let result = tool
249 .execute(
250 &serde_json::json!({
251 "file_path": "test.txt",
252 "old_string": "xyz",
253 "new_string": "abc"
254 }),
255 &ctx,
256 )
257 .await
258 .unwrap();
259
260 assert!(!result.success);
261 assert!(result.content.contains("not found"));
262 }
263
264 #[test]
265 fn test_edit_schema_is_canonical() {

Callers

nothing calls this directly

Calls 3

writeFunction · 0.85
pathMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected