From b290c924a81edf315898673ac73779f802be0f2a Mon Sep 17 00:00:00 2001 From: Ayrton Chilibeck Date: Sun, 14 Jan 2024 12:45:20 -0700 Subject: [PATCH] Added function stubs --- src/validate.rs | 50 +++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 48 insertions(+), 2 deletions(-) diff --git a/src/validate.rs b/src/validate.rs index 8064ae6..afab496 100644 --- a/src/validate.rs +++ b/src/validate.rs @@ -32,13 +32,40 @@ pub fn validate(verbosity: u8, config: util::config::Config) { // - check if either file is in the invalid list // - add to the notification queue let mut in_to_out: (Vec<(PathBuf, PathBuf)>, Vec) = map_files(in_files, out_files); - let invalid: Vec<(PathBuf, PathBuf)> = check_files(in_to_out[0]); + let invalid: Vec<(PathBuf, PathBuf)> = check_mappings(in_to_out.0, in_suffix, out_suffix); - print_invalid_mappings(in_to_out[1]); + print_unmached(in_to_out.1); print_invalid_pairs(invalid); } +/** + * @brief Maps input files to output files based on their stem + * + * @param in_files: The test input files + * @param out_files: The test output files + * + * @return A tuple of two elements: + * - A vector containing the file mappings from input to output (if found) + * - A vector containing paths for which a match was not found +*/ +fn map_files(in_files: Vec, out_files: Vec) -> (Vec<(PathBuf, PathBuf)>, Vec) { + +} + +/** + * @brief Checks that a given mapping is valid, containing the correct suffixes + * + * @param mappings between two files + * @param the expected in_suffix + * @param the expected out_suffix + * + * @return A vector of tuples with (input, output) PathBufs +*/ +fn check_mappings(mappings: Vec<(PathBuf, PathBuf)>, in_suffix: &str, out_suffix: &str) -> Vec<(PathBuf, PathBuf)> { + +} + /** * @brief Collects paths with invalid suffixes * @@ -110,6 +137,25 @@ fn print_invalid_suffixes(files: Vec, exp: &str) { } } +/** + * @brief Utility function to pring unmatched files + * + * @param unmatched: Unmatched files +*/ +fn print_unmached(unmatched: Vec) { + +} + +/** + * @brief Utility function to print invalid pairs + * + * @param invalid: A vector of invalid pairs +*/ +fn print_invalid_pairs(invalid: Vec<(PathBuf, PathBuf)>) { + +} + + #[cfg(test)] mod tests { use rstest::{fixture, rstest};