| 143 | |
| 144 | #[tokio::test] |
| 145 | async fn test_glob_recursive() { |
| 146 | let temp = tempfile::tempdir().unwrap(); |
| 147 | let sub = temp.path().join("sub"); |
| 148 | std::fs::create_dir(&sub).unwrap(); |
| 149 | std::fs::write(temp.path().join("root.rs"), "").unwrap(); |
| 150 | std::fs::write(sub.join("nested.rs"), "").unwrap(); |
| 151 | |
| 152 | let tool = GlobTool; |
| 153 | let ctx = ToolContext::new(temp.path().to_path_buf()); |
| 154 | |
| 155 | let result = tool |
| 156 | .execute(&serde_json::json!({"pattern": "**/*.rs"}), &ctx) |
| 157 | .await |
| 158 | .unwrap(); |
| 159 | |
| 160 | assert!(result.success); |
| 161 | assert!(result.content.contains("root.rs")); |
| 162 | assert!(result.content.contains("nested.rs")); |
| 163 | } |
| 164 | |
| 165 | #[tokio::test] |
| 166 | async fn test_glob_missing_pattern() { |