File: cl_error_messages.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 (24 lines) | stat: -rw-r--r-- 551 bytes parent folder | download | duplicates (6)
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)