tests/test_util_multitable.lua

changeset 3540
bc139431830b
parent 2923
b7049746bd29
equal deleted inserted replaced
3539:8bbd965267b2 3540:bc139431830b
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);

mercurial