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

Function test_grep_case_insensitive

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

Source from the content-addressed store, hash-verified

179
180 #[tokio::test]
181 async fn test_grep_case_insensitive() {
182 let temp = tempfile::tempdir().unwrap();
183 std::fs::write(temp.path().join("a.txt"), "Hello World\nhello world").unwrap();
184
185 let tool = GrepTool;
186 let ctx = ToolContext::new(temp.path().to_path_buf());
187
188 let result = tool
189 .execute(&serde_json::json!({"pattern": "hello", "-i": true}), &ctx)
190 .await
191 .unwrap();
192
193 assert!(result.success);
194 assert!(result.content.contains("2 match(es)"));
195 }
196
197 #[tokio::test]
198 async fn test_grep_invalid_regex() {

Callers

nothing calls this directly

Calls 3

writeFunction · 0.85
pathMethod · 0.80
executeMethod · 0.45

Tested by

no test coverage detected