equal
deleted
inserted
replaced
30 for n, item in ipairs(list) do |
30 for n, item in ipairs(list) do |
31 if not should_have[item] then return false, "too-many"; end |
31 if not should_have[item] then return false, "too-many"; end |
32 should_have[item] = nil; |
32 should_have[item] = nil; |
33 end |
33 end |
34 if next(should_have) then |
34 if next(should_have) then |
35 return false, "not-enough"; |
35 return false, "not-enough"; |
36 end |
36 end |
37 return true, "has-all"; |
37 return true, "has-all"; |
38 end |
38 end |
39 local function assert_has_all(message, list, ...) |
39 local function assert_has_all(message, list, ...) |
40 return assert_equal(select(2, has_items(list, ...)), "has-all", message or "List has all expected items, and no more", 2); |
40 return assert_equal(select(2, has_items(list, ...)), "has-all", message or "List has all expected items, and no more", 2); |