Fix test after changing fuzzy matching for empty queries

This commit is contained in:
Nathan Sobo 2022-05-09 20:41:18 -06:00
parent 3dee656490
commit ef868ff023

View file

@ -319,7 +319,10 @@ mod tests {
.into_iter()
.map(|name| StringMatchCandidate::new(0, name.into()))
.collect::<Vec<_>>();
let matches = fuzzy::match_strings(
let matches = if params.query.is_empty() {
Vec::new()
} else {
fuzzy::match_strings(
&candidates,
&params.query,
true,
@ -327,7 +330,9 @@ mod tests {
&Default::default(),
executor.clone(),
)
.await;
.await
};
Ok(Some(
matches.into_iter().map(|mat| symbol(&mat.string)).collect(),
))