Fix fuzzy match without no partial match
This commit is contained in:
@@ -128,7 +128,17 @@ matcher.match = function(input, word, option)
|
||||
end
|
||||
|
||||
if #matches == 0 then
|
||||
return 0, {}
|
||||
matches = {
|
||||
{
|
||||
index = 1,
|
||||
input_match_start = 1,
|
||||
input_match_end = 1,
|
||||
word_match_start = 1,
|
||||
word_match_end = 1,
|
||||
strict_ratio = 0,
|
||||
fuzzy = false,
|
||||
}
|
||||
}
|
||||
end
|
||||
|
||||
matcher.debug(word, matches)
|
||||
|
||||
@@ -36,6 +36,13 @@ describe('matcher', function()
|
||||
|
||||
assert.is.truthy(matcher.match('Unit', 'net.UnixListener', { disallow_partial_fuzzy_matching = true }) == 0)
|
||||
assert.is.truthy(matcher.match('Unit', 'net.UnixListener', { disallow_partial_fuzzy_matching = false }) >= 1)
|
||||
|
||||
assert.is.truthy(matcher.match('tail', 'HCDetails', {
|
||||
disallow_fuzzy_matching = false,
|
||||
disallow_partial_matching = false,
|
||||
disallow_prefix_unmatching = false,
|
||||
disallow_partial_fuzzy_matching = false,
|
||||
}) >= 1)
|
||||
end)
|
||||
|
||||
it('disallow_fuzzy_matching', function()
|
||||
|
||||
Reference in New Issue
Block a user