Fix fuzzy matching option check and matched position

This commit is contained in:
hrsh7th
2023-02-15 00:30:03 +09:00
parent 1b2e843a69
commit a926412e16
2 changed files with 22 additions and 17 deletions

View File

@@ -37,12 +37,23 @@ 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', {
local score, matches
score, matches = matcher.match('tail', 'HCDetails', {
disallow_fuzzy_matching = false,
disallow_partial_matching = false,
disallow_prefix_unmatching = false,
disallow_partial_fuzzy_matching = false,
}) >= 1)
})
assert.is.truthy(score >= 1)
assert.equals(matches[1].word_match_start, 5)
score, matches = matcher.match('tail', 'HCDetails', {
disallow_fuzzy_matching = false,
disallow_partial_matching = false,
disallow_prefix_unmatching = false,
disallow_partial_fuzzy_matching = true,
})
assert.is.truthy(score == 0)
end)
it('disallow_fuzzy_matching', function()