Better tests for gray lists

Test uses an extra bit in 'marked' to mark all elements in gray lists
and then check against elements colored gray.
This commit is contained in:
Roberto Ierusalimschy
2020-08-07 14:45:20 -03:00
parent 7c3cb71fa4
commit f13dc59416
3 changed files with 37 additions and 10 deletions

View File

@@ -88,6 +88,7 @@ for _, sa in ipairs(sizes) do -- 'sa' is size of the array part
arr[1 + sa + sh + 1] = "}"
local prog = table.concat(arr)
local f = assert(load(prog))
collectgarbage("stop")
f() -- call once to ensure stack space
-- make sure table is not resized after being created
if sa == 0 or sh == 0 then
@@ -97,6 +98,7 @@ for _, sa in ipairs(sizes) do -- 'sa' is size of the array part
end
local t = f()
T.alloccount();
collectgarbage("restart")
assert(#t == sa)
check(t, sa, mp2(sh))
end