From 6fe2c9c6499d913cf7af1e32b7a87e2e4afc1f3a Mon Sep 17 00:00:00 2001 From: Daniel Hofstetter Date: Tue, 14 May 2024 09:06:46 +0200 Subject: [PATCH] find: replace zip with nested loops in tests --- src/find/mod.rs | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/find/mod.rs b/src/find/mod.rs index 190bb34e..44524455 100644 --- a/src/find/mod.rs +++ b/src/find/mod.rs @@ -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"), + ); + } } } @@ -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(), ""); + } } }