Asserts that `file_path` is found anywhere in any of `dir` directories
(
file_path: &'a Path,
dirs: impl Iterator<Item = &'a Path>,
)
| 558 | |
| 559 | /// Asserts that `file_path` is found anywhere in any of `dir` directories |
| 560 | fn assert_path_in_dirs<'a>( |
| 561 | file_path: &'a Path, |
| 562 | dirs: impl Iterator<Item = &'a Path>, |
| 563 | ) { |
| 564 | let dirs: Vec<&Path> = dirs.collect(); |
| 565 | |
| 566 | let found = dirs.iter().any(|dir_path| { |
| 567 | file_path |
| 568 | .ancestors() |
| 569 | .any(|candidate_path| *dir_path == candidate_path) |
| 570 | }); |
| 571 | |
| 572 | assert!(found, "Can't find {file_path:?} in dirs: {dirs:?}"); |
| 573 | } |
| 574 | |
| 575 | #[test] |
| 576 | fn test_temp_file_still_alive_after_disk_manager_dropped() -> Result<()> { |
searching dependent graphs…