| 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() { |