From fbefb54b0269b9cf225ba2d39f51892c9f9c21c3 Mon Sep 17 00:00:00 2001 From: tommady Date: Thu, 22 May 2025 06:41:30 +0000 Subject: [PATCH] enhance test Signed-off-by: tommady --- tests/integration.rs | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/tests/integration.rs b/tests/integration.rs index ef157bd..9087533 100644 --- a/tests/integration.rs +++ b/tests/integration.rs @@ -895,24 +895,22 @@ fn unpack_multiple_sources_into_the_same_destination_with_merge( .assert() .success(); - assert_eq!(20, count_files_recursively(&out_path)); -} - -fn count_files_recursively(dir: &Path) -> usize { - let mut count = 0; - // println!("{:?}", dir); - if let Ok(entries) = fs::read_dir(dir) { - for entry in entries.flatten() { - let path = entry.path(); - if path.is_file() { - // println!("{:?}", path); - count += 1; - } else if path.is_dir() { - count += count_files_recursively(&path); + fn count_files_recursively(dir: &Path) -> usize { + let mut count = 0; + if let Ok(entries) = fs::read_dir(dir) { + for entry in entries.flatten() { + let path = entry.path(); + if path.is_file() { + count += 1; + } else if path.is_dir() { + count += count_files_recursively(&path); + } } } + count } - count + + assert_eq!(20, count_files_recursively(&out_path)); } #[test]