Fix tests
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com> Co-authored-by: Ben Brandt <benjamin.j.brandt@gmail.com> Co-authored-by: Matt Miller <mattrx@gmail.com>
This commit is contained in:
parent
e773919250
commit
5bf1a13aa2
1 changed files with 15 additions and 13 deletions
|
@ -165,15 +165,17 @@ fn search_paths(glob: &str, project: Entity<Project>, cx: &mut App) -> Task<Resu
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
cx.background_spawn(async move {
|
cx.background_spawn(async move {
|
||||||
Ok(snapshots
|
let mut results = Vec::new();
|
||||||
.iter()
|
for snapshot in snapshots {
|
||||||
.flat_map(|snapshot| {
|
for entry in snapshot.entries(false, 0) {
|
||||||
snapshot
|
let root_name = PathBuf::from(snapshot.root_name());
|
||||||
.entries(false, 0)
|
if path_matcher.is_match(root_name.join(&entry.path)) {
|
||||||
.map(move |entry| snapshot.abs_path().join(&entry.path))
|
results.push(snapshot.abs_path().join(entry.path.as_ref()));
|
||||||
.filter(|path| path_matcher.is_match(&path))
|
}
|
||||||
})
|
}
|
||||||
.collect())
|
}
|
||||||
|
|
||||||
|
Ok(results)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,8 +216,8 @@ mod test {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
matches,
|
matches,
|
||||||
&[
|
&[
|
||||||
PathBuf::from("root/apple/banana/carrot"),
|
PathBuf::from("/root/apple/banana/carrot"),
|
||||||
PathBuf::from("root/apple/bandana/carbonara")
|
PathBuf::from("/root/apple/bandana/carbonara")
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -226,8 +228,8 @@ mod test {
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
matches,
|
matches,
|
||||||
&[
|
&[
|
||||||
PathBuf::from("root/apple/banana/carrot"),
|
PathBuf::from("/root/apple/banana/carrot"),
|
||||||
PathBuf::from("root/apple/bandana/carbonara")
|
PathBuf::from("/root/apple/bandana/carbonara")
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue