Merge pull request #2037 from parneetsingh022/tests/search-str-for-entry-edge-cases

Add tests for search_str_for_entry without base dir
This commit is contained in:
Thayne McCombs authored and GitHub committed 2026-06-28 23:44:14 -06:00
commit 95dc6454d5
1 file changed
+16
+16
View File
@@ -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")
);
}
}