diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2020-09-12 19:04:22 -0700 |
---|---|---|
committer | TJ DeVries <devries.timothyj@gmail.com> | 2020-10-05 09:47:59 -0400 |
commit | 8e77d70e29f936f4e708ee3244046188b8ad0383 (patch) | |
tree | de9bfa3d5704cf9cfb92fc9a50157718d940b518 /test/functional/lua/treesitter_spec.lua | |
parent | aad7a74053e16611de04da4151e3e3be50746e3d (diff) | |
download | rneovim-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/lua/treesitter_spec.lua')
-rw-r--r-- | test/functional/lua/treesitter_spec.lua | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/functional/lua/treesitter_spec.lua b/test/functional/lua/treesitter_spec.lua index 74ae6cde2b..ac0074a4c3 100644 --- a/test/functional/lua/treesitter_spec.lua +++ b/test/functional/lua/treesitter_spec.lua @@ -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) |