X-Git-Url: https://git.r.bdr.sh/rbdr/page/blobdiff_plain/5732d284ebc2cc2cbde0f050443b8f137dbf585b..b03284133baa6339fe4adf48e4a6499ef3ac287b:/src/file_finder.rs diff --git a/src/file_finder.rs b/src/file_finder.rs index 754412a..a9b84f8 100644 --- a/src/file_finder.rs +++ b/src/file_finder.rs @@ -38,7 +38,7 @@ mod tests { use crate::file_handler::FileType; use test_utilities::*; - fn get_paths(root_directory: &PathBuf, files: &Vec) -> HashSet { + fn get_paths(root_directory: &PathBuf, files: &[File]) -> HashSet { files .iter() .map(|file| { @@ -54,8 +54,8 @@ mod tests { #[test] fn finds_all_files() { let test_dir = setup_test_dir(); - create_dir_all(&test_dir.join("nested")).expect("Could not create nested test directory"); - create_dir_all(&test_dir.join("assets")).expect("Could not create assets test directory"); + create_dir_all(test_dir.join("nested")).expect("Could not create nested test directory"); + create_dir_all(test_dir.join("assets")).expect("Could not create assets test directory"); create_test_file(&test_dir.join("test1.gmi"), ""); create_test_file(&test_dir.join("_layout.html"), ""); create_test_file(&test_dir.join("nested/nested.gmi"), ""); @@ -75,8 +75,8 @@ mod tests { #[test] fn identifies_correct_file_types() { let test_dir = setup_test_dir(); - create_dir_all(&test_dir.join("nested")).expect("Could not create nested test directory"); - create_dir_all(&test_dir.join("assets")).expect("Could not create assets test directory"); + create_dir_all(test_dir.join("nested")).expect("Could not create nested test directory"); + create_dir_all(test_dir.join("assets")).expect("Could not create assets test directory"); create_test_file(&test_dir.join("_layout.html"), ""); create_test_file(&test_dir.join("nested/nested.gmi"), ""); create_test_file(&test_dir.join("assets/style.css"), ""); @@ -102,9 +102,9 @@ mod tests { #[test] fn ignores_git_directory() { let test_dir = setup_test_dir(); - create_dir_all(&test_dir.join("nested")).expect("Could not create nested test directory"); - create_dir_all(&test_dir.join("assets")).expect("Could not create assets test directory"); - create_dir_all(&test_dir.join(".git")).expect("Could not create git test directory"); + create_dir_all(test_dir.join("nested")).expect("Could not create nested test directory"); + create_dir_all(test_dir.join("assets")).expect("Could not create assets test directory"); + create_dir_all(test_dir.join(".git")).expect("Could not create git test directory"); create_test_file(&test_dir.join("_layout.html"), ""); create_test_file(&test_dir.join("nested/nested.gmi"), ""); create_test_file(&test_dir.join("assets/style.css"), "");