mirror of
https://github.com/neovim/neovim.git
synced 2025-12-16 03:15:39 +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
@@ -15,14 +15,14 @@ before_each(clear)
|
||||
describe('treesitter API', function()
|
||||
-- error tests not requiring a parser library
|
||||
it('handles missing language', function()
|
||||
eq("Error executing lua: .../language.lua: no parser for 'borklang' language, see :help treesitter-parsers",
|
||||
eq("Error executing lua: .../language.lua:0: no parser for 'borklang' language, see :help treesitter-parsers",
|
||||
pcall_err(exec_lua, "parser = vim.treesitter.get_parser(0, 'borklang')"))
|
||||
|
||||
-- actual message depends on platform
|
||||
matches("Error executing lua: Failed to load parser: uv_dlopen: .+",
|
||||
pcall_err(exec_lua, "parser = vim.treesitter.require_language('borklang', 'borkbork.so')"))
|
||||
|
||||
eq("Error executing lua: .../language.lua: no parser for 'borklang' language, see :help treesitter-parsers",
|
||||
eq("Error executing lua: .../language.lua:0: no parser for 'borklang' language, see :help treesitter-parsers",
|
||||
pcall_err(exec_lua, "parser = vim.treesitter.inspect_language('borklang')"))
|
||||
end)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user