Remove separator! macro and make path! handle relative paths (#32527)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-06-13 00:32:29 -06:00 committed by GitHub
parent babf846ef9
commit 9cc82212b5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 302 additions and 343 deletions

View file

@ -51,7 +51,7 @@ use std::{
time::Duration,
};
use unindent::Unindent as _;
use util::{path, separator, uri};
use util::{path, uri};
use workspace::Pane;
#[ctor::ctor]
@ -1676,13 +1676,13 @@ async fn test_project_reconnect(
.map(|p| p.to_str().unwrap())
.collect::<Vec<_>>(),
vec![
separator!("a.txt"),
separator!("b.txt"),
separator!("subdir2"),
separator!("subdir2/f.txt"),
separator!("subdir2/g.txt"),
separator!("subdir2/h.txt"),
separator!("subdir2/i.txt")
path!("a.txt"),
path!("b.txt"),
path!("subdir2"),
path!("subdir2/f.txt"),
path!("subdir2/g.txt"),
path!("subdir2/h.txt"),
path!("subdir2/i.txt")
]
);
assert!(worktree_a3.read(cx).has_update_observer());
@ -1709,13 +1709,13 @@ async fn test_project_reconnect(
.map(|p| p.to_str().unwrap())
.collect::<Vec<_>>(),
vec![
separator!("a.txt"),
separator!("b.txt"),
separator!("subdir2"),
separator!("subdir2/f.txt"),
separator!("subdir2/g.txt"),
separator!("subdir2/h.txt"),
separator!("subdir2/i.txt")
path!("a.txt"),
path!("b.txt"),
path!("subdir2"),
path!("subdir2/f.txt"),
path!("subdir2/g.txt"),
path!("subdir2/h.txt"),
path!("subdir2/i.txt")
]
);
assert!(project.worktree_for_id(worktree2_id, cx).is_none());
@ -1806,13 +1806,13 @@ async fn test_project_reconnect(
.map(|p| p.to_str().unwrap())
.collect::<Vec<_>>(),
vec![
separator!("a.txt"),
separator!("b.txt"),
separator!("subdir2"),
separator!("subdir2/f.txt"),
separator!("subdir2/g.txt"),
separator!("subdir2/h.txt"),
separator!("subdir2/j.txt")
path!("a.txt"),
path!("b.txt"),
path!("subdir2"),
path!("subdir2/f.txt"),
path!("subdir2/g.txt"),
path!("subdir2/h.txt"),
path!("subdir2/j.txt")
]
);
assert!(project.worktree_for_id(worktree2_id, cx).is_none());
@ -3315,13 +3315,13 @@ async fn test_fs_operations(
.map(|p| p.to_string_lossy())
.collect::<Vec<_>>(),
[
separator!("DIR"),
separator!("DIR/SUBDIR"),
separator!("DIR/SUBDIR/f.txt"),
separator!("DIR/e.txt"),
separator!("a.txt"),
separator!("b.txt"),
separator!("d.txt")
path!("DIR"),
path!("DIR/SUBDIR"),
path!("DIR/SUBDIR/f.txt"),
path!("DIR/e.txt"),
path!("a.txt"),
path!("b.txt"),
path!("d.txt")
]
);
});
@ -3333,13 +3333,13 @@ async fn test_fs_operations(
.map(|p| p.to_string_lossy())
.collect::<Vec<_>>(),
[
separator!("DIR"),
separator!("DIR/SUBDIR"),
separator!("DIR/SUBDIR/f.txt"),
separator!("DIR/e.txt"),
separator!("a.txt"),
separator!("b.txt"),
separator!("d.txt")
path!("DIR"),
path!("DIR/SUBDIR"),
path!("DIR/SUBDIR/f.txt"),
path!("DIR/e.txt"),
path!("a.txt"),
path!("b.txt"),
path!("d.txt")
]
);
});
@ -3359,14 +3359,14 @@ async fn test_fs_operations(
.map(|p| p.to_string_lossy())
.collect::<Vec<_>>(),
[
separator!("DIR"),
separator!("DIR/SUBDIR"),
separator!("DIR/SUBDIR/f.txt"),
separator!("DIR/e.txt"),
separator!("a.txt"),
separator!("b.txt"),
separator!("d.txt"),
separator!("f.txt")
path!("DIR"),
path!("DIR/SUBDIR"),
path!("DIR/SUBDIR/f.txt"),
path!("DIR/e.txt"),
path!("a.txt"),
path!("b.txt"),
path!("d.txt"),
path!("f.txt")
]
);
});
@ -3378,14 +3378,14 @@ async fn test_fs_operations(
.map(|p| p.to_string_lossy())
.collect::<Vec<_>>(),
[
separator!("DIR"),
separator!("DIR/SUBDIR"),
separator!("DIR/SUBDIR/f.txt"),
separator!("DIR/e.txt"),
separator!("a.txt"),
separator!("b.txt"),
separator!("d.txt"),
separator!("f.txt")
path!("DIR"),
path!("DIR/SUBDIR"),
path!("DIR/SUBDIR/f.txt"),
path!("DIR/e.txt"),
path!("a.txt"),
path!("b.txt"),
path!("d.txt"),
path!("f.txt")
]
);
});

View file

@ -30,7 +30,7 @@ use rpc::proto;
use serde_json::json;
use settings::SettingsStore;
use std::{path::Path, sync::Arc};
use util::{path, separator};
use util::path;
#[gpui::test(iterations = 10)]
async fn test_sharing_an_ssh_remote_project(
@ -198,7 +198,7 @@ async fn test_sharing_an_ssh_remote_project(
.path()
.to_string_lossy()
.to_string(),
separator!("src/renamed.rs").to_string()
path!("src/renamed.rs").to_string()
);
});
}