From 4280545e8c1078187486958209b5f82ed660c615 Mon Sep 17 00:00:00 2001 From: xffxff <1247714429@qq.com> Date: Thu, 24 Aug 2023 09:32:22 +0800 Subject: [PATCH] add a test for non-existent file --- src/results/aggregator.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/results/aggregator.rs b/src/results/aggregator.rs index e753aea..c2d6885 100644 --- a/src/results/aggregator.rs +++ b/src/results/aggregator.rs @@ -257,4 +257,16 @@ mod tests { Ok(()) } + + #[test] + fn test_filter_with_lists_file_not_found() { + let mut map_to_be_filtered = HashMap::new(); + + let mut resultant_map = HashMap::new(); + + // Call the `filter_with_lists` function with a non-existent file path + let result = filter_with_lists(&mut map_to_be_filtered, &mut resultant_map, "non-existent-file.txt"); + + assert!(result.is_err()); + } } \ No newline at end of file