File: cl_gc_error.lua

package info (click to toggle)
lua-busted 2.3.0-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 820 kB
  • sloc: sh: 198; makefile: 2
file content (9 lines) | stat: -rw-r--r-- 285 bytes parent folder | download | duplicates (6)
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)