Compare commits

...

7 Commits

Author SHA1 Message Date
Ayrton Chilibeck 4cd54923c9
Implemented the map checker
- Tests passing
2024-01-14 17:00:12 -07:00
Ayrton Chilibeck 809e6837eb
Implementation and Tests of map_files
- Changed the config.yaml to reflect testing needs
- Completed the function implementation
- Tests passing
2024-01-14 16:46:12 -07:00
Ayrton Chilibeck 775dfab349
Added tests for stubbed functions 2024-01-14 13:21:23 -07:00
Ayrton Chilibeck b290c924a8
Added function stubs 2024-01-14 12:45:20 -07:00
Ayrton Chilibeck 777654b574
Chaged tests, Added stubs 2024-01-14 12:31:51 -07:00
Ayrton Chilibeck c142ccc4dc
Fixecd printing implementation for invalid suffix 2024-01-14 11:58:14 -07:00
Ayrton Chilibeck c798b44f45
Implemented a function to collect invalid suffixes 2024-01-13 23:24:29 -07:00
4 changed files with 513 additions and 53 deletions

229
Cargo.lock generated
View File

@ -2,6 +2,15 @@
# It is not intended for manual editing. # It is not intended for manual editing.
version = 3 version = 3
[[package]]
name = "aho-corasick"
version = "1.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0"
dependencies = [
"memchr",
]
[[package]] [[package]]
name = "anstream" name = "anstream"
version = "0.6.7" version = "0.6.7"
@ -50,6 +59,18 @@ dependencies = [
"windows-sys", "windows-sys",
] ]
[[package]]
name = "autocfg"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
[[package]]
name = "cfg-if"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
[[package]] [[package]]
name = "clap" name = "clap"
version = "4.4.16" version = "4.4.16"
@ -102,6 +123,107 @@ version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
[[package]]
name = "futures"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "645c6916888f6cb6350d2550b80fb63e734897a8498abe35cfb732b6487804b0"
dependencies = [
"futures-channel",
"futures-core",
"futures-executor",
"futures-io",
"futures-sink",
"futures-task",
"futures-util",
]
[[package]]
name = "futures-channel"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "eac8f7d7865dcb88bd4373ab671c8cf4508703796caa2b1985a9ca867b3fcb78"
dependencies = [
"futures-core",
"futures-sink",
]
[[package]]
name = "futures-core"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "dfc6580bb841c5a68e9ef15c77ccc837b40a7504914d52e47b8b0e9bbda25a1d"
[[package]]
name = "futures-executor"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a576fc72ae164fca6b9db127eaa9a9dda0d61316034f33a0a0d4eda41f02b01d"
dependencies = [
"futures-core",
"futures-task",
"futures-util",
]
[[package]]
name = "futures-io"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a44623e20b9681a318efdd71c299b6b222ed6f231972bfe2f224ebad6311f0c1"
[[package]]
name = "futures-macro"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "87750cf4b7a4c0625b1529e4c543c2182106e4dedc60a2a6455e00d212c489ac"
dependencies = [
"proc-macro2",
"quote",
"syn",
]
[[package]]
name = "futures-sink"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9fb8e00e87438d937621c1c6269e53f536c14d3fbd6a042bb24879e57d474fb5"
[[package]]
name = "futures-task"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "38d84fa142264698cdce1a9f9172cf383a0c82de1bddcf3092901442c4097004"
[[package]]
name = "futures-timer"
version = "3.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c"
[[package]]
name = "futures-util"
version = "0.3.30"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "3d6401deb83407ab3da39eba7e33987a73c3df0c82b4bb5813ee871c19c41d48"
dependencies = [
"futures-channel",
"futures-core",
"futures-io",
"futures-macro",
"futures-sink",
"futures-task",
"memchr",
"pin-project-lite",
"pin-utils",
"slab",
]
[[package]]
name = "glob"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b"
[[package]] [[package]]
name = "hashbrown" name = "hashbrown"
version = "0.14.3" version = "0.14.3"
@ -130,6 +252,24 @@ version = "1.0.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c"
[[package]]
name = "memchr"
version = "2.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149"
[[package]]
name = "pin-project-lite"
version = "0.2.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58"
[[package]]
name = "pin-utils"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]] [[package]]
name = "proc-macro2" name = "proc-macro2"
version = "1.0.76" version = "1.0.76"
@ -148,12 +288,91 @@ dependencies = [
"proc-macro2", "proc-macro2",
] ]
[[package]]
name = "regex"
version = "1.10.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343"
dependencies = [
"aho-corasick",
"memchr",
"regex-automata",
"regex-syntax",
]
[[package]]
name = "regex-automata"
version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f"
dependencies = [
"aho-corasick",
"memchr",
"regex-syntax",
]
[[package]]
name = "regex-syntax"
version = "0.8.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f"
[[package]]
name = "relative-path"
version = "1.9.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e898588f33fdd5b9420719948f9f2a32c922a246964576f71ba7f24f80610fbc"
[[package]]
name = "rstest"
version = "0.18.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "97eeab2f3c0a199bc4be135c36c924b6590b88c377d416494288c14f2db30199"
dependencies = [
"futures",
"futures-timer",
"rstest_macros",
"rustc_version",
]
[[package]]
name = "rstest_macros"
version = "0.18.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d428f8247852f894ee1be110b375111b586d4fa431f6c46e64ba5a0dcccbe605"
dependencies = [
"cfg-if",
"glob",
"proc-macro2",
"quote",
"regex",
"relative-path",
"rustc_version",
"syn",
"unicode-ident",
]
[[package]]
name = "rustc_version"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366"
dependencies = [
"semver",
]
[[package]] [[package]]
name = "ryu" name = "ryu"
version = "1.0.16" version = "1.0.16"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c"
[[package]]
name = "semver"
version = "1.0.21"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b97ed7a9823b74f99c7742f5336af7be5ecd3eeafcb1507d1fa93347b1d589b0"
[[package]] [[package]]
name = "serde" name = "serde"
version = "1.0.195" version = "1.0.195"
@ -187,6 +406,15 @@ dependencies = [
"unsafe-libyaml", "unsafe-libyaml",
] ]
[[package]]
name = "slab"
version = "0.4.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8f92a496fb766b417c996b9c5e57daf2f7ad3b0bebe1ccfca4856390e3d3bb67"
dependencies = [
"autocfg",
]
[[package]] [[package]]
name = "strsim" name = "strsim"
version = "0.10.0" version = "0.10.0"
@ -209,6 +437,7 @@ name = "tester"
version = "0.1.0" version = "0.1.0"
dependencies = [ dependencies = [
"clap", "clap",
"rstest",
"serde", "serde",
"serde_yaml", "serde_yaml",
] ]

View File

@ -7,5 +7,6 @@ edition = "2021"
[dependencies] [dependencies]
clap = { version = "4.4.16", features = ["derive"] } clap = { version = "4.4.16", features = ["derive"] }
rstest = "0.18.2"
serde = { version = "1.0.195", features = ["derive"] } serde = { version = "1.0.195", features = ["derive"] }
serde_yaml = "0.9.30" serde_yaml = "0.9.30"

View File

@ -1,6 +1,6 @@
input_path: "/path/to/dir" input_path: "/test/in"
output_path: "/path/to/out/dir" output_path: "/test/out"
in_stream_path: "/path/to/in/stream" in_stream_path: "/test/instream"
tested_executables: tested_executables:
- name: "team1" - name: "team1"

View File

@ -1,4 +1,4 @@
use std::{path::PathBuf, fs}; use std::{path::{PathBuf, Path, Components, Component}, fs, collections::{HashMap, VecDeque}, borrow::BorrowMut};
use crate::util; use crate::util;
@ -8,39 +8,160 @@ pub fn validate(verbosity: u8, config: util::config::Config) {
let in_suffix = "in"; //TODO make this configurable? let in_suffix = "in"; //TODO make this configurable?
let out_suffix = "out"; let out_suffix = "out";
// get list of all file names in input/output // get list of all file names in input/output
let in_files: Vec<PathBuf> = get_dir_files(config.input_path).expect("Failed to read the input directory contents"); let in_files: Vec<PathBuf> = get_dir_files(&config.input_path).expect("Failed to read the input directory contents");
let out_files: Vec<PathBuf> = get_dir_files(config.output_path).expect("Failed to read the output directory contents"); let out_files: Vec<PathBuf> = get_dir_files(&config.output_path).expect("Failed to read the output directory contents");
let mismatch: Vec<(PathBuf, PathBuf)>; let mismatch: Vec<(PathBuf, PathBuf)>;
let mut invalid_suffix_in: Vec<PathBuf> = vec![];
let mut invalid_suffix_out: Vec<PathBuf> = vec![];
// check if they end in .in or .out respectively // check the files for valid suffixes
for file in in_files { let invalid_suffix_in: Vec<PathBuf> = collect_invalid(&in_files, in_suffix);
if !file.ends_with(in_suffix) { let invalid_suffix_out: Vec<PathBuf> = collect_invalid(&out_files, out_suffix);
invalid_suffix_in.push(file);
}
}
for file in out_files {
if !file.ends_with(out_suffix) {
invalid_suffix_out.push(file);
}
}
// print the delinquints // print the delinquints
if invalid_suffix_in.len() > 0 { if invalid_suffix_in.len() > 0 {
print_invalid_suffixes(invalid_suffix_in, String::from(in_suffix)); print_invalid_suffixes(invalid_suffix_in, in_suffix);
} }
if invalid_suffix_out.len() > 0 { if invalid_suffix_out.len() > 0 {
print_invalid_suffixes(invalid_suffix_out, String::from(out_suffix)); print_invalid_suffixes(invalid_suffix_out, out_suffix);
} }
// make sure each has a match // make sure each has a match
let in_to_out: (Vec<(PathBuf, PathBuf)>, Vec<PathBuf>) = map_files(in_files, out_files, &config);
let invalid: Vec<(PathBuf, PathBuf)> = check_mappings(in_to_out.0, in_suffix, out_suffix);
print_unmached(in_to_out.1);
print_invalid_pairs(invalid, in_suffix, out_suffix);
} }
fn get_dir_files(path: PathBuf) -> Result<Vec<PathBuf>, &'static str> { /**
* @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<PathBuf>, out_files: Vec<PathBuf>, config: &util::config::Config) -> (Vec<(PathBuf, PathBuf)>, Vec<PathBuf>) {
let mut res: (Vec<(PathBuf, PathBuf)>, Vec<PathBuf>) = (vec![], vec![]);
// get the prefixes
let mut in_prefix = vec![];
for pre in config.input_path.components() {
in_prefix.push(pre);
}
let mut out_prefix = vec![];
for pre in config.output_path.components() {
out_prefix.push(pre);
}
// check if the files have the same paths relative to in/out directory
for ifile in &in_files {
let mut found = false;
// get the components of the path
let mut in_comp: VecDeque<Component> = VecDeque::from(vec![]);
for tmp in ifile.components() {
in_comp.push_back(tmp);
}
in_comp.pop_back();
// check if the files share common ancestors except for the first path
for ofile in &out_files {
// get the components of the path
let mut out_comp: VecDeque<Component> = VecDeque::from(vec![]);
for tmp in ofile.components() {
out_comp.push_back(tmp);
}
out_comp.pop_back();
// println!("{:?}", ofile);
// println!("{:?}", out_comp);
// check if the file names are the same
if ofile.file_stem() == ifile.file_stem() {
// check that their paths are the same relative to the input/output directory
for comp in &in_prefix { if &comp == &in_comp.front().expect("Failed to extract") { in_comp.pop_front(); } }
for comp in &out_prefix { if &comp == &out_comp.front().expect("Failed to extract") { out_comp.pop_front(); } }
println!("{:?}\n{:?}\n{:?}", in_prefix, in_comp,out_comp);
// if the files match, then we add them to the mapping
if out_comp == in_comp {
println!("Added to map");
res.0.push((ifile.clone(), ofile.clone()));
found = true;
}
}
}
// if we fail to find a match, we add the file to the rest
if !found { res.1.push(ifile.clone()); }
}
let mut cl: Vec<PathBuf> = Vec::from(out_files.clone());
let mut r: Vec<PathBuf> = vec![];
for tup in &res.0 {
r.push(tup.1.clone());
}
cl.retain(|x| !r.contains(&x));
res.1.append(&mut cl);
// println!("{:?}", res);
return res;
}
/**
* @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)> {
let mut res: Vec<(PathBuf, PathBuf)> = vec![];
for tup in &mappings {
if !(tup.0.as_path().extension().unwrap() == in_suffix) || !(tup.1.as_path().extension().unwrap() == out_suffix) {
res.push(tup.clone());
}
}
// println!("{:?}", res);
return res;
}
/**
* @brief Collects paths with invalid suffixes
*
* @param files: A vector of PathBuf containing file names
* @param suf: The expected suffix for the files
*
* @return A vector of paths with invalid suffixes
*/
fn collect_invalid(files: &Vec<PathBuf>, suf: &str) -> Vec<PathBuf> {
let mut res: Vec<PathBuf> = vec![];
for file in files {
let extension = file.extension().expect("Invalid file name for validation");
if extension.to_str() != Some(suf) {
res.push(file.clone());
}
}
println!("{:?}", res);
return res
}
/**
* @brief Get all file names in a directory
*
* @param path: the path to the target directory
*
* @returns Result with a Vector of PathBuf or error
*/
fn get_dir_files(path: &PathBuf) -> Result<Vec<PathBuf>, &'static str> {
let mut res: Vec<PathBuf> = vec![]; let mut res: Vec<PathBuf> = vec![];
// get the readout of the path for error handling // get the readout of the path for error handling
@ -61,33 +182,13 @@ fn get_dir_files(path: PathBuf) -> Result<Vec<PathBuf>, &'static str> {
return Ok(res); return Ok(res);
} }
fn compare_files(in_files: Vec<PathBuf>, out_files: Vec<PathBuf>) -> Vec<PathBuf> { /**
let mut res: Vec<PathBuf> = vec![]; * @brief Print utility for the invalid paths
*
res.append(&mut compare_list(in_files, out_files)); * @param files: A vector containing the invalid path names
res.append(&mut compare_list(out_files, in_files)); * @param exp: The expected suffix
*/
return res; fn print_invalid_suffixes(files: Vec<PathBuf>, exp: &str) {
}
fn compare_list(from: Vec<PathBuf>, against: Vec<PathBuf>) -> Vec<PathBuf> {
let res: Vec<PathBuf> = vec![];
// Compare each input file to each output file
for file in from {
let beg = file.file_stem().unwrap(); // ignore suffix
for out in against {
if beg == out.file_stem().unwrap() {
break;
}
}
res.push(file); // if the file does not have a counterpart, then push to the lost files
}
return res;
}
fn print_invalid_suffixes(files: Vec<PathBuf>, exp: String) {
println!("Invalid suffixes detected 😱:" ); println!("Invalid suffixes detected 😱:" );
println!("Current => Suggested"); println!("Current => Suggested");
for mut file in files { for mut file in files {
@ -96,11 +197,140 @@ fn print_invalid_suffixes(files: Vec<PathBuf>, exp: String) {
_ => panic!("Failed to load the file"), _ => panic!("Failed to load the file"),
}; };
println!("{} => {}", initial, file.set_extension(exp).to_string()); println!("{} => {}.{}",
initial.to_string(),
file.file_stem().expect("failed to extract")
.to_str().expect("failed to transform"),
exp);
} }
} }
#[cfg(test)] /**
mod tests { * @brief Utility function to pring unmatched files
*
* @param unmatched: Unmatched files
*/
fn print_unmached(unmatched: Vec<PathBuf>) {
} }
/**
* @brief Utility function to print invalid pairs and suggest a fix
*
* @param invalid: A vector of invalid pairs
*/
fn print_invalid_pairs(invalid: Vec<(PathBuf, PathBuf)>, in_suffix: &str, out_suffix: &str) {
}
#[cfg(test)]
mod tests {
use rstest::{fixture, rstest};
use super::*;
#[fixture]
fn files() -> Vec<PathBuf> {
let valid_path1 = PathBuf::from("path/file.suf");
let valid_path2 = PathBuf::from("path/file_stupid.suf");
let valid_path3 = PathBuf::from("path/file/dead.suf");
let invalid_path1 = PathBuf::from("path/file.sub");
let invalid_path2 = PathBuf::from("path/file_stupid.sur");
let invalid_path3 = PathBuf::from("path/file.bub");
let files: Vec<PathBuf> = vec![valid_path1.clone(), valid_path2.clone(), valid_path3.clone(),
invalid_path1.clone(), invalid_path2.clone(), invalid_path3.clone()];
return files;
}
#[fixture]
fn in_files() -> Vec<PathBuf> {
let invalid_map11 = PathBuf::from("/test/in/inv/path/file.in ");
let invalid_map12 = PathBuf::from("/test/in/inv/path/file_stupid.in");
let invalid_map13 = PathBuf::from("/test/in/inv/path/dead.inn");
let valid_map11 = PathBuf::from("/test/in/val/path/file.in");
let valid_map12 = PathBuf::from("/test/in/val/path/file_stupid.in");
let valid_map13 = PathBuf::from("/test/in/val/path/file/dead.in");
let in_files = vec![invalid_map11, invalid_map12, invalid_map13,
valid_map11, valid_map12, valid_map13];
return in_files;
}
#[fixture]
fn out_files() -> Vec<PathBuf> {
let invalid_map21 = PathBuf::from("/test/out/inv/path/file.out");
let invalid_map22 = PathBuf::from("/test/out/inv/path/file_stupid.out ");
let invalid_map23 = PathBuf::from("/test/out/inv/path/file/dead.outt");
let valid_map21 = PathBuf::from("/test/out/val/path/file.out");
let valid_map22 = PathBuf::from("/test/out/val/path/file_stupid.out");
let valid_map23 = PathBuf::from("/test/out/val/path/file/dead.out");
let out_files = vec![invalid_map21, invalid_map22, invalid_map23,
valid_map21, valid_map22, valid_map23];
return out_files;
}
#[fixture]
fn config() -> util::config::Config {
return util::config::parse_config(PathBuf::from("src/util/test/parse_config/config.yaml"));
}
#[rstest]
fn test_collect_invalid(files: Vec<PathBuf>) {
let suffix = "suf";
let invalid = collect_invalid(&files, suffix);
println!("{:?}", invalid);
// visual testing for the print formatting
print_invalid_suffixes(invalid.clone(), suffix);
assert!(!invalid.contains(&files[0]));
assert!(!invalid.contains(&files[1]));
assert!(!invalid.contains(&files[2]));
assert!(invalid.contains(&files[3]));
assert!(invalid.contains(&files[4]));
assert!(invalid.contains(&files[5]));
}
#[rstest]
fn test_map(in_files: Vec<PathBuf>, out_files: Vec<PathBuf>, config: util::config::Config) {
let mappings: (Vec<(PathBuf, PathBuf)>, Vec<PathBuf>) = map_files(in_files.clone(), out_files.clone(), &config);
// print_unmached(mappings.1);
let test = (in_files[0].clone(), out_files[0].clone());
assert!(&mappings.0.contains(&test), "The mapping does not contain {:?}", test);
assert!(&mappings.0.contains(&(in_files[1].clone(), out_files[1].clone())));
assert!(!&mappings.0.contains(&(in_files[2].clone(), out_files[2].clone())));
assert!(&mappings.0.contains(&(in_files[3].clone(), out_files[3].clone())));
assert!(&mappings.0.contains(&(in_files[4].clone(), out_files[4].clone())));
assert!(&mappings.0.contains(&(in_files[5].clone(), out_files[5].clone())));
assert!(&mappings.1.contains(&in_files[2]));
assert!(&mappings.1.contains(&out_files[2]));
}
#[rstest]
fn test_check_valid_mappings(in_files: Vec<PathBuf>, out_files: Vec<PathBuf>, config: util::config::Config) {
let in_suffix = "in";
let out_suffix = "out";
let invalid: Vec<(PathBuf, PathBuf)> = check_mappings(map_files(in_files.clone(), out_files.clone(), &config).0, in_suffix, out_suffix);
print_invalid_pairs(invalid.clone(), in_suffix, out_suffix);
assert!(&invalid.contains(&(in_files[0].clone(), out_files[0].clone())));
assert!(&invalid.contains(&(in_files[1].clone(), out_files[1].clone())));
assert!(!&invalid.contains(&(in_files[2].clone(), out_files[2].clone())));
assert!(!&invalid.contains(&(in_files[3].clone(), out_files[3].clone())));
assert!(!&invalid.contains(&(in_files[4].clone(), out_files[4].clone())));
assert!(!&invalid.contains(&(in_files[5].clone(), out_files[5].clone())));
}
}