1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
-- supporting testfile; belongs to 'cl_spec.lua'
describe('Test error messages show file and line for', function()
it('table errors #table', function()
error({})
end)
it('nil errors #nil', function()
error()
end)
it('string errors #string', function()
error('error message')
end)
it('table errors #tostring', function()
error(setmetatable({}, { __tostring = function() return '{}' end}))
end)
it('table errors #pcall', function()
pcall(error, 'error inside pcall')
error('error after pcall')
end)
end)
|