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

Function test_grep_no_match

core/src/tools/builtin/grep.rs:164–178  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

162
163 #[tokio::test]
164 async fn test_grep_no_match() {
165 let temp = tempfile::tempdir().unwrap();
166 std::fs::write(temp.path().join("a.txt"), "hello").unwrap();
167
168 let tool = GrepTool;
169 let ctx = ToolContext::new(temp.path().to_path_buf());
170
171 let result = tool
172 .execute(&serde_json::json!({"pattern": "xyz"}), &ctx)
173 .await
174 .unwrap();
175
176 assert!(result.success);
177 assert!(result.content.contains("No matches found"));
178 }
179
180 #[tokio::test]
181 async fn test_grep_case_insensitive() {

Callers

nothing calls this directly

Calls 3

writeFunction · 0.85
pathMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected