aboutsummaryrefslogtreecommitdiff
path: root/test/functional
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/helpers.lua1
-rw-r--r--test/functional/treesitter/language_spec.lua6
2 files changed, 5 insertions, 2 deletions
diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua
index 981cfc306e..93fb0f245e 100644
--- a/test/functional/helpers.lua
+++ b/test/functional/helpers.lua
@@ -761,6 +761,7 @@ function module.pending_c_parser(pending_fn)
pending_fn 'no C parser, skipping'
return true
end
+ module.exec_lua [[vim._ts_remove_language 'c']]
return false
end
diff --git a/test/functional/treesitter/language_spec.lua b/test/functional/treesitter/language_spec.lua
index 5eb72471c3..8aa8524a26 100644
--- a/test/functional/treesitter/language_spec.lua
+++ b/test/functional/treesitter/language_spec.lua
@@ -27,8 +27,10 @@ describe('treesitter language API', function()
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')"))
- matches("Error executing lua: Failed to load parser: uv_dlsym: .+",
- pcall_err(exec_lua, "parser = vim.treesitter.require_language('c', nil, false, 'borklang')"))
+ if not pending_c_parser(pending) then
+ matches("Error executing lua: Failed to load parser: uv_dlsym: .+",
+ pcall_err(exec_lua, 'vim.treesitter.require_language("c", nil, false, "borklang")'))
+ end
end)
it('inspects language', function()