project_panel: Fix the confusing display when files or directories have the same name in a case-insensitive comparison (#19211)
- Closes #18851 Release Notes: - Fixed directory name comparison on Linux not considering the case ([#18851](https://github.com/zed-industries/zed/issues/18851))
This commit is contained in:
parent
6c7e79eff6
commit
d53a86b01d
2 changed files with 43 additions and 4 deletions
|
@ -433,6 +433,38 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn compare_paths_case_semi_sensitive() {
|
||||
let mut paths = vec![
|
||||
(Path::new("test_DIRS"), false),
|
||||
(Path::new("test_DIRS/foo_1"), true),
|
||||
(Path::new("test_DIRS/foo_2"), true),
|
||||
(Path::new("test_DIRS/bar"), true),
|
||||
(Path::new("test_DIRS/BAR"), true),
|
||||
(Path::new("test_dirs"), false),
|
||||
(Path::new("test_dirs/foo_1"), true),
|
||||
(Path::new("test_dirs/foo_2"), true),
|
||||
(Path::new("test_dirs/bar"), true),
|
||||
(Path::new("test_dirs/BAR"), true),
|
||||
];
|
||||
paths.sort_by(|&a, &b| compare_paths(a, b));
|
||||
assert_eq!(
|
||||
paths,
|
||||
vec![
|
||||
(Path::new("test_dirs"), false),
|
||||
(Path::new("test_dirs/bar"), true),
|
||||
(Path::new("test_dirs/BAR"), true),
|
||||
(Path::new("test_dirs/foo_1"), true),
|
||||
(Path::new("test_dirs/foo_2"), true),
|
||||
(Path::new("test_DIRS"), false),
|
||||
(Path::new("test_DIRS/bar"), true),
|
||||
(Path::new("test_DIRS/BAR"), true),
|
||||
(Path::new("test_DIRS/foo_1"), true),
|
||||
(Path::new("test_DIRS/foo_2"), true),
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn path_with_position_parse_posix_path() {
|
||||
// Test POSIX filename edge cases
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue