diff options
author | Thomas Vigouroux <tomvig38@gmail.com> | 2020-12-10 11:12:39 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-10 11:12:39 +0100 |
commit | 99007bcc1254717bb7d3803bf4b892a6153bd091 (patch) | |
tree | eff6e023a90ed2b710235594b1f3d8ec7c0a056a /test/functional/lua/treesitter_spec.lua | |
parent | 00f60c2ce78fc1280e93d5a36bc7b2267d5f4ac6 (diff) | |
parent | e15c5f58df52ee05d042c4696c72c3fbb4457eee (diff) | |
download | rneovim-99007bcc1254717bb7d3803bf4b892a6153bd091.tar.gz rneovim-99007bcc1254717bb7d3803bf4b892a6153bd091.tar.bz2 rneovim-99007bcc1254717bb7d3803bf4b892a6153bd091.zip |
Merge pull request #13450 from nvim-treesitter/fix-unknown-language-parser
fix(treesitter): don't throw an error for missing injected langs
Diffstat (limited to 'test/functional/lua/treesitter_spec.lua')
-rw-r--r-- | test/functional/lua/treesitter_spec.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/functional/lua/treesitter_spec.lua b/test/functional/lua/treesitter_spec.lua index 0e823426ae..f34cbbb65b 100644 --- a/test/functional/lua/treesitter_spec.lua +++ b/test/functional/lua/treesitter_spec.lua @@ -22,6 +22,10 @@ describe('treesitter API', function() matches("Error executing lua: Failed to load parser: uv_dlopen: .+", pcall_err(exec_lua, "parser = vim.treesitter.require_language('borklang', 'borkbork.so')")) + -- Should not throw an error when silent + eq(false, exec_lua("return vim.treesitter.require_language('borklang', nil, true)")) + eq(false, exec_lua("return vim.treesitter.require_language('borklang', 'borkbork.so', true)")) + 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) |