Fix fuzzy matching option check and matched position
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user