diff --git a/src/bin_foreign_document_test.rs b/src/bin_foreign_document_test.rs index 8b2975b..60802ea 100644 --- a/src/bin_foreign_document_test.rs +++ b/src/bin_foreign_document_test.rs @@ -1,12 +1,10 @@ #![feature(round_char_boundary)] #![feature(exact_size_is_empty)] -use std::io::Read; use std::path::Path; use std::path::PathBuf; use futures::future::BoxFuture; use futures::future::FutureExt; -use organic::compare::run_compare_on_file; use organic::compare::silent_compare_on_file; use tokio::sync::Semaphore; use tokio::task::JoinError; @@ -85,14 +83,23 @@ fn compare_all_org_document>(root_dir: P) -> impl Iterator, _>>() .unwrap(); - let test_configs = test_files.into_iter().map(|test_file| { - let name = test_file.path().as_os_str().to_string_lossy().into_owned(); - TestConfig::SingleFile(SingleFile { - name, - file_path: test_file.into_path(), + let test_configs: Vec<_> = test_files + .into_iter() + .map(|test_file| { + let name = test_file + .path() + .strip_prefix(root_dir) + .expect("Result is from walkdir so it must be below the root directory.") + .as_os_str() + .to_string_lossy() + .into_owned(); + TestConfig::SingleFile(SingleFile { + name, + file_path: test_file.into_path(), + }) }) - }); - test_configs + .collect(); + test_configs.into_iter() } static TEST_PERMITS: Semaphore = Semaphore::const_new(8);