From 86c1e7d30d0216d2d462141ec6dc358e72f5f055 Mon Sep 17 00:00:00 2001 From: Parneet Date: Fri, 26 Jun 2026 16:59:06 +0530 Subject: [PATCH] Add tests for search_str_for_entry without base dir --- src/walk.rs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/walk.rs b/src/walk.rs index 018ad2f..73c03bd 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -735,4 +735,20 @@ mod tests { PathBuf::from("bar") ); } + + #[test] + fn search_str_no_base_dir_with_plain_relative_path() { + assert_eq!( + search_str_for_entry(Path::new("foo/bar"), None), + PathBuf::from("bar") + ); + } + + #[test] + fn search_str_no_base_dir_with_file_in_current_dir() { + assert_eq!( + search_str_for_entry(Path::new("foo"), None), + PathBuf::from("foo") + ); + } }