mirror of
https://github.com/nushell/nushell.git
synced 2025-08-15 09:53:13 +02:00
Fix fuzzy sort score test
This commit is contained in:
@ -245,10 +245,11 @@ mod test {
|
|||||||
match_algorithm: MatchAlgorithm::Fuzzy,
|
match_algorithm: MatchAlgorithm::Fuzzy,
|
||||||
..Default::default()
|
..Default::default()
|
||||||
};
|
};
|
||||||
let mut matcher = NuMatcher::new("foo bar", options);
|
let mut matcher = NuMatcher::new("fob", options);
|
||||||
for item in ["foo/bar", "bar/foo", "foobar"] {
|
for item in ["foo/bar", "fob", "foo bar"] {
|
||||||
matcher.add(item.to_string(), item);
|
matcher.add(item.to_string(), item);
|
||||||
}
|
}
|
||||||
assert_eq!(vec!["bar/foo", "foo/bar", "foobar"], matcher.results());
|
// Sort by score, then in alphabetical order
|
||||||
|
assert_eq!(vec!["fob", "foo bar", "foo/bar"], matcher.results());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user