Make test_propagate_saves_and_fs_changes
more robust
...by using a condition that awaits on the actual paths as opposed to the simple file counts.
This commit is contained in:
parent
e354133be0
commit
ca052b4a4d
1 changed files with 18 additions and 27 deletions
|
@ -1629,38 +1629,29 @@ mod tests {
|
||||||
.unwrap();
|
.unwrap();
|
||||||
|
|
||||||
worktree_a
|
worktree_a
|
||||||
.condition(&cx_a, |tree, _| tree.file_count() == 4)
|
.condition(&cx_a, |tree, _| {
|
||||||
|
tree.paths()
|
||||||
|
.map(|p| p.to_string_lossy())
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
== [".zed.toml", "file1-renamed", "file3", "file4"]
|
||||||
|
})
|
||||||
.await;
|
.await;
|
||||||
worktree_b
|
worktree_b
|
||||||
.condition(&cx_b, |tree, _| tree.file_count() == 4)
|
.condition(&cx_b, |tree, _| {
|
||||||
|
tree.paths()
|
||||||
|
.map(|p| p.to_string_lossy())
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
== [".zed.toml", "file1-renamed", "file3", "file4"]
|
||||||
|
})
|
||||||
.await;
|
.await;
|
||||||
worktree_c
|
worktree_c
|
||||||
.condition(&cx_c, |tree, _| tree.file_count() == 4)
|
.condition(&cx_c, |tree, _| {
|
||||||
|
tree.paths()
|
||||||
|
.map(|p| p.to_string_lossy())
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
== [".zed.toml", "file1-renamed", "file3", "file4"]
|
||||||
|
})
|
||||||
.await;
|
.await;
|
||||||
worktree_a.read_with(&cx_a, |tree, _| {
|
|
||||||
assert_eq!(
|
|
||||||
tree.paths()
|
|
||||||
.map(|p| p.to_string_lossy())
|
|
||||||
.collect::<Vec<_>>(),
|
|
||||||
&[".zed.toml", "file1-renamed", "file3", "file4"]
|
|
||||||
)
|
|
||||||
});
|
|
||||||
worktree_b.read_with(&cx_b, |tree, _| {
|
|
||||||
assert_eq!(
|
|
||||||
tree.paths()
|
|
||||||
.map(|p| p.to_string_lossy())
|
|
||||||
.collect::<Vec<_>>(),
|
|
||||||
&[".zed.toml", "file1-renamed", "file3", "file4"]
|
|
||||||
)
|
|
||||||
});
|
|
||||||
worktree_c.read_with(&cx_c, |tree, _| {
|
|
||||||
assert_eq!(
|
|
||||||
tree.paths()
|
|
||||||
.map(|p| p.to_string_lossy())
|
|
||||||
.collect::<Vec<_>>(),
|
|
||||||
&[".zed.toml", "file1-renamed", "file3", "file4"]
|
|
||||||
)
|
|
||||||
});
|
|
||||||
|
|
||||||
// Ensure buffer files are updated as well.
|
// Ensure buffer files are updated as well.
|
||||||
buffer_a
|
buffer_a
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue