New test module 'tracegc'

New module easies the inclusion of GC tracing in individual test files.
This commit is contained in:
Roberto Ierusalimschy
2021-03-01 13:54:29 -03:00
parent f9d857a81b
commit 5276973224
4 changed files with 54 additions and 18 deletions

View File

@@ -5,6 +5,8 @@ print('testing local variables and environments')
local debug = require"debug"
local tracegc = require"tracegc"
-- bug in 5.1:
@@ -554,9 +556,9 @@ do -- test for tbc variable high in the stack
obj[1] = 100
flag = obj
end)
collectgarbage("stop")
tracegc.stop()
st, obj = xpcall(overflow, errorh, 0)
collectgarbage("restart")
tracegc.start()
end)
co()
assert(not st and obj[1] == 10 and flag[1] == 100)