aboutsummaryrefslogtreecommitdiff
path: root/testes
diff options
context:
space:
mode:
authorRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-08-07 14:45:20 -0300
committerRoberto Ierusalimschy <roberto@inf.puc-rio.br>2020-08-07 14:45:20 -0300
commitf13dc59416afa8fc93bb3d784d1a73e49e1b5b09 (patch)
tree4719b653c8cbb3e0651e97ebb7acb96ac3a7a13d /testes
parent7c3cb71fa48fbe84d9d9c664eb646446fb80898b (diff)
downloadlua-f13dc59416afa8fc93bb3d784d1a73e49e1b5b09.tar.gz
lua-f13dc59416afa8fc93bb3d784d1a73e49e1b5b09.tar.bz2
lua-f13dc59416afa8fc93bb3d784d1a73e49e1b5b09.zip
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.
Diffstat (limited to 'testes')
-rw-r--r--testes/nextvar.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/testes/nextvar.lua b/testes/nextvar.lua
index 73af77dd..a16d557b 100644
--- a/testes/nextvar.lua
+++ b/testes/nextvar.lua
@@ -88,6 +88,7 @@ for _, sa in ipairs(sizes) do -- 'sa' is size of the array part
88 arr[1 + sa + sh + 1] = "}" 88 arr[1 + sa + sh + 1] = "}"
89 local prog = table.concat(arr) 89 local prog = table.concat(arr)
90 local f = assert(load(prog)) 90 local f = assert(load(prog))
91 collectgarbage("stop")
91 f() -- call once to ensure stack space 92 f() -- call once to ensure stack space
92 -- make sure table is not resized after being created 93 -- make sure table is not resized after being created
93 if sa == 0 or sh == 0 then 94 if sa == 0 or sh == 0 then
@@ -97,6 +98,7 @@ for _, sa in ipairs(sizes) do -- 'sa' is size of the array part
97 end 98 end
98 local t = f() 99 local t = f()
99 T.alloccount(); 100 T.alloccount();
101 collectgarbage("restart")
100 assert(#t == sa) 102 assert(#t == sa)
101 check(t, sa, mp2(sh)) 103 check(t, sa, mp2(sh))
102 end 104 end