aboutsummaryrefslogtreecommitdiff
path: root/test/functional/api/vim_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/api/vim_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/api/vim_spec.lua')
-rw-r--r--test/functional/api/vim_spec.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua
index 72e810e3e4..246ee5c86c 100644
--- a/test/functional/api/vim_spec.lua
+++ b/test/functional/api/vim_spec.lua
@@ -449,19 +449,19 @@ describe('API', function()
end)
it('reports errors', function()
- eq([[Error loading lua: [string "<nvim>"]:1: '=' expected near '+']],
+ eq([[Error loading lua: [string "<nvim>"]:0: '=' expected near '+']],
pcall_err(meths.exec_lua, 'a+*b', {}))
- eq([[Error loading lua: [string "<nvim>"]:1: unexpected symbol near '1']],
+ eq([[Error loading lua: [string "<nvim>"]:0: unexpected symbol near '1']],
pcall_err(meths.exec_lua, '1+2', {}))
- eq([[Error loading lua: [string "<nvim>"]:1: unexpected symbol]],
+ eq([[Error loading lua: [string "<nvim>"]:0: unexpected symbol]],
pcall_err(meths.exec_lua, 'aa=bb\0', {}))
- eq([[Error executing lua: [string "<nvim>"]:1: attempt to call global 'bork' (a nil value)]],
+ eq([[Error executing lua: [string "<nvim>"]:0: attempt to call global 'bork' (a nil value)]],
pcall_err(meths.exec_lua, 'bork()', {}))
- eq('Error executing lua: [string "<nvim>"]:1: did\nthe\nfail',
+ eq('Error executing lua: [string "<nvim>"]:0: did\nthe\nfail',
pcall_err(meths.exec_lua, 'error("did\\nthe\\nfail")', {}))
end)
@@ -605,7 +605,7 @@ describe('API', function()
end)
it('vim.paste() failure', function()
nvim('exec_lua', 'vim.paste = (function(lines, phase) error("fake fail") end)', {})
- eq([[Error executing lua: [string "<nvim>"]:1: fake fail]],
+ eq([[Error executing lua: [string "<nvim>"]:0: fake fail]],
pcall_err(request, 'nvim_paste', 'line 1\nline 2\nline 3', false, 1))
end)
end)