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