()
| 165 | |
| 166 | #[test] |
| 167 | fn test_detect_ignores_node_modules_and_git() { |
| 168 | let temp = TempDir::new().unwrap(); |
| 169 | let project_root = temp.path(); |
| 170 | |
| 171 | // Create directories that should be ignored (line 126 coverage) |
| 172 | fs::create_dir_all(project_root.join("node_modules")).unwrap(); |
| 173 | fs::create_dir_all(project_root.join(".git")).unwrap(); |
| 174 | fs::create_dir_all(project_root.join("target")).unwrap(); |
| 175 | fs::create_dir_all(project_root.join("src")).unwrap(); |
| 176 | |
| 177 | fs::write(project_root.join("src/main.rs"), "fn main() {}").unwrap(); |
| 178 | fs::write(project_root.join("node_modules/test.js"), "test").unwrap(); |
| 179 | fs::write( |
| 180 | project_root.join("Cargo.toml"), |
| 181 | "[package]\nname = \"test\"", |
| 182 | ) |
| 183 | .unwrap(); |
| 184 | |
| 185 | let detector = catalog_detector(); |
| 186 | let mut cache = ContentCache::new(); |
| 187 | let detections = detector.detect(project_root, &mut cache).unwrap(); |
| 188 | |
| 189 | let tech_ids: Vec<_> = detections |
| 190 | .iter() |
| 191 | .map(|d| d.technology.as_ref().to_string()) |
| 192 | .collect(); |
| 193 | assert!(tech_ids.contains(&"rust".to_string()), "Should detect Rust"); |
| 194 | |
| 195 | // The detector should not have scanned node_modules or .git |
| 196 | // (we can't directly test this, but the test exercises the ignore logic) |
| 197 | } |
| 198 | |
| 199 | #[test] |
| 200 | fn test_content_cache_reuses_reads() { |
nothing calls this directly
no test coverage detected