File: cl_gc_error.lua

package info (click to toggle)
lua-busted 2.0~rc12-1-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 656 kB
  • ctags: 310
  • sloc: sh: 191; makefile: 6
file content (9 lines) | stat: -rw-r--r-- 285 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
-- supporting testfile; belongs to 'cl_spec.lua'

describe('Runs test with garbage collection failure', function()
  it('throws error in __gc metamethod', function()
    setmetatable({}, { __gc = function() error('gc error') end})
    collectgarbage()
    collectgarbage()
  end)
end)