aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/lsp_spec.lua
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2020-09-12 19:04:22 -0700
committerTJ DeVries <devries.timothyj@gmail.com>2020-10-05 09:47:59 -0400
commit8e77d70e29f936f4e708ee3244046188b8ad0383 (patch)
treede9bfa3d5704cf9cfb92fc9a50157718d940b518 /test/functional/plugin/lsp_spec.lua
parentaad7a74053e16611de04da4151e3e3be50746e3d (diff)
downloadrneovim-8e77d70e29f936f4e708ee3244046188b8ad0383.tar.gz
rneovim-8e77d70e29f936f4e708ee3244046188b8ad0383.tar.bz2
rneovim-8e77d70e29f936f4e708ee3244046188b8ad0383.zip
test/vim.validate(): assert normalized stacktrace
- The previous commit lost information in the tests. Instead, add some more "normalization" substitutions in pcall_err(), so that the general shape of the stacktrace is included in the asserted text. - Eliminate contains(), it is redundant with matches()
Diffstat (limited to 'test/functional/plugin/lsp_spec.lua')
-rw-r--r--test/functional/plugin/lsp_spec.lua13
1 files changed, 10 insertions, 3 deletions
diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua
index 3c4c448e7a..f07a2d18a2 100644
--- a/test/functional/plugin/lsp_spec.lua
+++ b/test/functional/plugin/lsp_spec.lua
@@ -6,7 +6,6 @@ local buf_lines = helpers.buf_lines
local dedent = helpers.dedent
local exec_lua = helpers.exec_lua
local eq = helpers.eq
-local contains = helpers.contains
local pcall_err = helpers.pcall_err
local pesc = helpers.pesc
local insert = helpers.insert
@@ -748,8 +747,16 @@ describe('LSP', function()
end)
it('should invalid cmd argument', function()
- contains('cmd: expected list, got nvim', pcall_err(_cmd_parts, "nvim"))
- contains('cmd argument: expected string, got number', pcall_err(_cmd_parts, {"nvim", 1}))
+ eq(dedent([[
+ Error executing lua: .../lsp.lua:0: cmd: expected list, got nvim
+ stack traceback:
+ .../lsp.lua:0: in function .../lsp.lua:0>]]),
+ 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>]]),
+ pcall_err(_cmd_parts, {'nvim', 1}))
end)
end)
end)