Sort files in a compare_all_org_document.

This commit is contained in:
Tom Alexander 2023-10-14 17:26:59 -04:00
parent 00611e05c2
commit ff04c4a131
Signed by: talexander
GPG Key ID: D3A179C9A53C0EDE

View File

@ -107,7 +107,7 @@ fn compare_group<N: Into<String>, F: Fn() -> I, I: Iterator<Item = TestConfig>>(
fn compare_all_org_document<P: AsRef<Path>>(root_dir: P) -> impl Iterator<Item = TestConfig> { fn compare_all_org_document<P: AsRef<Path>>(root_dir: P) -> impl Iterator<Item = TestConfig> {
let root_dir = root_dir.as_ref(); let root_dir = root_dir.as_ref();
let test_files = WalkDir::new(root_dir) let mut test_files = WalkDir::new(root_dir)
.into_iter() .into_iter()
.filter(|e| match e { .filter(|e| match e {
Ok(dir_entry) => { Ok(dir_entry) => {
@ -121,6 +121,7 @@ fn compare_all_org_document<P: AsRef<Path>>(root_dir: P) -> impl Iterator<Item =
}) })
.collect::<Result<Vec<_>, _>>() .collect::<Result<Vec<_>, _>>()
.unwrap(); .unwrap();
test_files.sort_by_cached_key(|test_file| PathBuf::from(test_file.path()));
let test_configs: Vec<_> = test_files let test_configs: Vec<_> = test_files
.into_iter() .into_iter()
.map(|test_file| { .map(|test_file| {