mirror of
https://github.com/neovim/neovim.git
synced 2025-10-10 03:46:31 +00:00
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()
This commit is contained in:

committed by
TJ DeVries

parent
aad7a74053
commit
8e77d70e29
@@ -477,14 +477,14 @@ describe('v:lua', function()
|
||||
eq(NIL, eval('v:lua.mymod.noisy("eval")'))
|
||||
eq("hey eval", meths.get_current_line())
|
||||
|
||||
eq("Vim:E5108: Error executing lua [string \"<nvim>\"]:10: attempt to call global 'nonexistent' (a nil value)",
|
||||
eq("Vim:E5108: Error executing lua [string \"<nvim>\"]:0: attempt to call global 'nonexistent' (a nil value)",
|
||||
pcall_err(eval, 'v:lua.mymod.crashy()'))
|
||||
end)
|
||||
|
||||
it('works in :call', function()
|
||||
command(":call v:lua.mymod.noisy('command')")
|
||||
eq("hey command", meths.get_current_line())
|
||||
eq("Vim(call):E5108: Error executing lua [string \"<nvim>\"]:10: attempt to call global 'nonexistent' (a nil value)",
|
||||
eq("Vim(call):E5108: Error executing lua [string \"<nvim>\"]:0: attempt to call global 'nonexistent' (a nil value)",
|
||||
pcall_err(command, 'call v:lua.mymod.crashy()'))
|
||||
end)
|
||||
|
||||
|
Reference in New Issue
Block a user