mirror of
https://github.com/neovim/neovim.git
synced 2026-01-06 21:37:43 +00:00
feat(lua): enable stack traces in error output (#16228)
This commit is contained in:
@@ -134,7 +134,7 @@ describe('health.vim', function()
|
||||
command("checkhealth test_plug*")
|
||||
local buf_lines = helpers.curbuf('get_lines', 0, -1, true)
|
||||
-- avoid dealing with path separators
|
||||
local received = table.concat(buf_lines, '\n', 1, #buf_lines - 2)
|
||||
local received = table.concat(buf_lines, '\n', 1, #buf_lines - 5)
|
||||
local expected = helpers.dedent([[
|
||||
|
||||
test_plug: require("test_plug.health").check()
|
||||
@@ -175,10 +175,10 @@ describe('health.vim', function()
|
||||
it("gracefully handles broken lua healthcheck", function()
|
||||
command("checkhealth test_plug.submodule_failed")
|
||||
local buf_lines = helpers.curbuf('get_lines', 0, -1, true)
|
||||
local received = table.concat(buf_lines, '\n', 1, #buf_lines - 2)
|
||||
local received = table.concat(buf_lines, '\n', 1, #buf_lines - 5)
|
||||
-- avoid dealing with path separators
|
||||
local lua_err = "attempt to perform arithmetic on a nil value"
|
||||
local last_line = buf_lines[#buf_lines - 1]
|
||||
local last_line = buf_lines[#buf_lines - 4]
|
||||
assert(string.find(last_line, lua_err) ~= nil, "Lua error not present")
|
||||
|
||||
local expected = global_helpers.dedent([[
|
||||
|
||||
@@ -1153,15 +1153,9 @@ describe('LSP', function()
|
||||
end)
|
||||
|
||||
it('should invalid cmd argument', function()
|
||||
eq(dedent([[
|
||||
Error executing lua: .../lsp.lua:0: cmd: expected list, got nvim
|
||||
stack traceback:
|
||||
.../lsp.lua:0: in function <.../lsp.lua:0>]]),
|
||||
eq('Error executing lua: .../lsp.lua:0: cmd: expected list, got nvim',
|
||||
pcall_err(_cmd_parts, 'nvim'))
|
||||
eq(dedent([[
|
||||
Error executing lua: .../lsp.lua:0: cmd argument: expected string, got number
|
||||
stack traceback:
|
||||
.../lsp.lua:0: in function <.../lsp.lua:0>]]),
|
||||
eq('Error executing lua: .../lsp.lua:0: cmd argument: expected string, got number',
|
||||
pcall_err(_cmd_parts, {'nvim', 1}))
|
||||
end)
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user