Skip to content

Commit

Permalink
find: replace zip with nested loops in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
cakebaker authored and sylvestre committed May 16, 2024
1 parent 70b7b36 commit 6fe2c9c
Showing 1 changed file with 17 additions and 13 deletions.
30 changes: 17 additions & 13 deletions src/find/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -921,15 +921,17 @@ mod tests {
let args = ["-newerat", "-newerBt", "-newerct", "-newermt"];
let times = ["jan 01, 2000", "jan 01, 2000 00:00:00"];

for (arg, time) in args.iter().zip(times.iter()) {
let deps = FakeDependencies::new();
let rc = find_main(&["find", "./test_data/simple/subdir", arg, time], &deps);
for arg in args {
for time in times {
let deps = FakeDependencies::new();
let rc = find_main(&["find", "./test_data/simple/subdir", arg, time], &deps);

assert_eq!(rc, 0);
assert_eq!(
deps.get_output_as_string(),
fix_up_slashes("./test_data/simple/subdir\n./test_data/simple/subdir/ABBBC\n"),
);
assert_eq!(rc, 0);
assert_eq!(
deps.get_output_as_string(),
fix_up_slashes("./test_data/simple/subdir\n./test_data/simple/subdir/ABBBC\n"),
);
}
}
}

Expand All @@ -942,12 +944,14 @@ mod tests {
let args = ["-newerat", "-newerBt", "-newerct", "-newermt"];
let times = ["jan 01, 2037", "jan 01, 2037 00:00:00"];

for (arg, time) in args.iter().zip(times.iter()) {
let deps = FakeDependencies::new();
let rc = find_main(&["find", "./test_data/simple/subdir", arg, time], &deps);
for arg in args {
for time in times {
let deps = FakeDependencies::new();
let rc = find_main(&["find", "./test_data/simple/subdir", arg, time], &deps);

assert_eq!(rc, 0);
assert_eq!(deps.get_output_as_string(), "");
assert_eq!(rc, 0);
assert_eq!(deps.get_output_as_string(), "");
}
}
}

Expand Down

0 comments on commit 6fe2c9c

Please sign in to comment.