Heuristic: is this path a test file?
(path: &str)
| 513 | |
| 514 | /// Heuristic: is this path a test file? |
| 515 | fn is_test_path(path: &str) -> bool { |
| 516 | let lower = path.to_lowercase(); |
| 517 | lower.contains("/test/") |
| 518 | || lower.contains("/tests/") |
| 519 | || lower.contains("_test.") |
| 520 | || lower.contains("_test_") |
| 521 | || lower.contains(".test.") |
| 522 | || lower.starts_with("test/") |
| 523 | || lower.starts_with("tests/") |
| 524 | || lower.starts_with("jstests/") |
| 525 | || lower.starts_with("testdata/") |
| 526 | } |
| 527 | |
| 528 | /// Check whether the content index exists and is usable. |
| 529 | pub fn has_content_index(repo_root: &Path) -> bool { |