Unit tests and clean up for dupe file feature

This commit is contained in:
Josh Megnauth 2024-05-13 22:32:47 -04:00 committed by Jeremy Soller
parent 14d485a7cb
commit ef32539aae
5 changed files with 238 additions and 28 deletions

View file

@ -2383,6 +2383,16 @@ pub(crate) mod test_utils {
}))
}
// Filter `path` for files
pub fn filter_files(path: &Path) -> io::Result<impl Iterator<Item = PathBuf>> {
Ok(path.read_dir()?.filter_map(|entry| {
entry.ok().and_then(|entry| {
let path = entry.path();
path.is_file().then_some(path)
})
}))
}
/// Boiler plate for Tab tests
pub fn tab_click_new(
files: usize,