Fix bug in new criteria matcher
This commit is contained in:
parent
09334b4b1c
commit
0e8915ec1d
@ -51,7 +51,7 @@
|
||||
function criteria.matches(crit, context)
|
||||
local checkterm = function(term)
|
||||
for _, value in ipairs(context) do
|
||||
if value:match(term) then
|
||||
if value:match(term) == value then
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
@ -45,3 +45,13 @@
|
||||
crit = criteria.new { "orange", "pear" }
|
||||
test.isfalse(criteria.matches(crit, { "apple", "orange" }))
|
||||
end
|
||||
|
||||
|
||||
--
|
||||
-- Context terms must match the entire criteria term.
|
||||
--
|
||||
|
||||
function suite.fails_onIncompleteMatch()
|
||||
crit = criteria.new { "ps3" }
|
||||
test.isfalse(criteria.matches(crit, { "ps3 ppu sn" }))
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user