diff options
author | Christian Clason <c.clason@uni-graz.at> | 2022-09-04 16:13:37 +0200 |
---|---|---|
committer | Christian Clason <c.clason@uni-graz.at> | 2022-09-06 07:57:46 +0200 |
commit | 6254b0fd3bc725705020192dc9e35635136b9929 (patch) | |
tree | 3e3c069c8fc12f8bab6400d9ff105a9050eac617 | |
parent | 905dd49fece0903dba4e5a618f503d0237415b14 (diff) | |
download | rneovim-6254b0fd3bc725705020192dc9e35635136b9929.tar.gz rneovim-6254b0fd3bc725705020192dc9e35635136b9929.tar.bz2 rneovim-6254b0fd3bc725705020192dc9e35635136b9929.zip |
ci(tests): don't skip parsers on functionaltest
Treesitter parsers are now a mandatory part of the installation and
should be tested on all platforms. Remove `pending_c_parser` helper.
-rwxr-xr-x | .github/workflows/env.sh | 2 | ||||
-rw-r--r-- | test/functional/helpers.lua | 10 | ||||
-rw-r--r-- | test/functional/treesitter/highlight_spec.lua | 18 | ||||
-rw-r--r-- | test/functional/treesitter/language_spec.lua | 12 | ||||
-rw-r--r-- | test/functional/treesitter/node_spec.lua | 5 | ||||
-rw-r--r-- | test/functional/treesitter/parser_spec.lua | 3 | ||||
-rw-r--r-- | test/functional/treesitter/utils_spec.lua | 2 |
7 files changed, 3 insertions, 49 deletions
diff --git a/.github/workflows/env.sh b/.github/workflows/env.sh index 061588da1a..da70d358a9 100755 --- a/.github/workflows/env.sh +++ b/.github/workflows/env.sh @@ -57,7 +57,7 @@ EOF functionaltest-lua) BUILD_FLAGS="$BUILD_FLAGS -DPREFER_LUA=ON" FUNCTIONALTEST=functionaltest-lua - DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF -DUSE_BUNDLED_TS_PARSERS=OFF" + DEPS_CMAKE_FLAGS="$DEPS_CMAKE_FLAGS -DUSE_BUNDLED_LUAJIT=OFF" ;; *) ;; diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 93fb0f245e..d672037a1e 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -755,16 +755,6 @@ function module.pending_win32(pending_fn) end end -function module.pending_c_parser(pending_fn) - local status, _ = unpack(module.exec_lua([[ return {pcall(vim.treesitter.require_language, 'c')} ]])) - if not status then - pending_fn 'no C parser, skipping' - return true - end - module.exec_lua [[vim._ts_remove_language 'c']] - return false -end - -- Calls pending() and returns `true` if the system is too slow to -- run fragile or expensive tests. Else returns `false`. function module.skip_fragile(pending_fn, cond) diff --git a/test/functional/treesitter/highlight_spec.lua b/test/functional/treesitter/highlight_spec.lua index 4b0bd1eb50..5a1081592e 100644 --- a/test/functional/treesitter/highlight_spec.lua +++ b/test/functional/treesitter/highlight_spec.lua @@ -5,7 +5,6 @@ local clear = helpers.clear local insert = helpers.insert local exec_lua = helpers.exec_lua local feed = helpers.feed -local pending_c_parser = helpers.pending_c_parser local command = helpers.command local meths = helpers.meths local eq = helpers.eq @@ -111,8 +110,6 @@ describe('treesitter highlighting', function() end) it('is updated with edits', function() - if pending_c_parser(pending) then return end - insert(hl_text) screen:expect{grid=[[ /// Schedule Lua callback on main loop's event queue | @@ -276,8 +273,6 @@ describe('treesitter highlighting', function() end) it('is updated with :sort', function() - if pending_c_parser(pending) then return end - insert(test_text) exec_lua [[ local parser = vim.treesitter.get_parser(0, "c") @@ -351,8 +346,6 @@ describe('treesitter highlighting', function() end) it("supports with custom parser", function() - if pending_c_parser(pending) then return end - screen:set_default_attr_ids { [1] = {bold = true, foreground = Screen.colors.SeaGreen4}; } @@ -417,8 +410,6 @@ describe('treesitter highlighting', function() end) it("supports injected languages", function() - if pending_c_parser(pending) then return end - insert([[ int x = INT_MAX; #define READ_STRING(x, y) (char_u *)read_string((x), (size_t)(y)) @@ -479,8 +470,6 @@ describe('treesitter highlighting', function() end) it("supports overriding queries, like ", function() - if pending_c_parser(pending) then return end - insert([[ int x = INT_MAX; #define READ_STRING(x, y) (char_u *)read_string((x), (size_t)(y)) @@ -520,8 +509,6 @@ describe('treesitter highlighting', function() end) it("supports highlighting with custom highlight groups", function() - if pending_c_parser(pending) then return end - insert(hl_text) exec_lua [[ @@ -577,8 +564,6 @@ describe('treesitter highlighting', function() end) it("supports highlighting with priority", function() - if pending_c_parser(pending) then return end - insert([[ int x = INT_MAX; #define READ_STRING(x, y) (char_u *)read_string((x), (size_t)(y)) @@ -625,8 +610,6 @@ describe('treesitter highlighting', function() end) it("allows to use captures with dots (don't use fallback when specialization of foo exists)", function() - if pending_c_parser(pending) then return end - insert([[ char* x = "Will somebody ever read this?"; ]]) @@ -708,7 +691,6 @@ describe('treesitter highlighting', function() end) it("supports conceal attribute", function() - if pending_c_parser(pending) then return end insert(hl_text) -- conceal can be empty or a single cchar. diff --git a/test/functional/treesitter/language_spec.lua b/test/functional/treesitter/language_spec.lua index 8e9941d797..ed84dedb5a 100644 --- a/test/functional/treesitter/language_spec.lua +++ b/test/functional/treesitter/language_spec.lua @@ -6,7 +6,6 @@ local command = helpers.command local exec_lua = helpers.exec_lua local pcall_err = helpers.pcall_err local matches = helpers.matches -local pending_c_parser = helpers.pending_c_parser local insert = helpers.insert before_each(clear) @@ -28,15 +27,11 @@ 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')")) - 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 + matches("Error executing lua: Failed to load parser: uv_dlsym: .+", + pcall_err(exec_lua, 'vim.treesitter.require_language("c", nil, false, "borklang")')) end) it('inspects language', function() - if pending_c_parser(pending) then return end - local keys, fields, symbols = unpack(exec_lua([[ local lang = vim.treesitter.inspect_language('c') local keys, symbols = {}, {} @@ -76,7 +71,6 @@ describe('treesitter language API', function() end) it('checks if vim.treesitter.get_parser tries to create a new parser on filetype change', function () - if pending_c_parser(pending) then return end command("set filetype=c") -- Should not throw an error when filetype is c eq('c', exec_lua("return vim.treesitter.get_parser(0):lang()")) @@ -87,7 +81,6 @@ describe('treesitter language API', function() end) it('retrieve the tree given a range', function () - if pending_c_parser(pending) then return end insert([[ int main() { int x = 3; @@ -102,7 +95,6 @@ describe('treesitter language API', function() end) it('retrieve the node given a range', function () - if pending_c_parser(pending) then return end insert([[ int main() { int x = 3; diff --git a/test/functional/treesitter/node_spec.lua b/test/functional/treesitter/node_spec.lua index 87ce1b973c..a82dce47b7 100644 --- a/test/functional/treesitter/node_spec.lua +++ b/test/functional/treesitter/node_spec.lua @@ -4,7 +4,6 @@ local clear = helpers.clear local eq = helpers.eq local exec_lua = helpers.exec_lua local insert = helpers.insert -local pending_c_parser = helpers.pending_c_parser before_each(clear) @@ -15,10 +14,6 @@ end describe('treesitter node API', function() clear() - if pending_c_parser(pending) then - return - end - it('can move between siblings', function() insert([[ int main(int x, int y, int z) { diff --git a/test/functional/treesitter/parser_spec.lua b/test/functional/treesitter/parser_spec.lua index 7f3b0e770a..ccbd55df0e 100644 --- a/test/functional/treesitter/parser_spec.lua +++ b/test/functional/treesitter/parser_spec.lua @@ -5,13 +5,11 @@ local eq = helpers.eq local insert = helpers.insert local exec_lua = helpers.exec_lua local feed = helpers.feed -local pending_c_parser = helpers.pending_c_parser before_each(clear) describe('treesitter parser API', function() clear() - if pending_c_parser(pending) then return end it('parses buffer', function() if helpers.pending_win32(pending) then return end @@ -249,7 +247,6 @@ void ui_refresh(void) end) it('supports getting text of multiline node', function() - if pending_c_parser(pending) then return end insert(test_text) local res = exec_lua([[ local parser = vim.treesitter.get_parser(0, "c") diff --git a/test/functional/treesitter/utils_spec.lua b/test/functional/treesitter/utils_spec.lua index 4f4c18a748..7f5a864c3d 100644 --- a/test/functional/treesitter/utils_spec.lua +++ b/test/functional/treesitter/utils_spec.lua @@ -4,7 +4,6 @@ local clear = helpers.clear local insert = helpers.insert local eq = helpers.eq local exec_lua = helpers.exec_lua -local pending_c_parser = helpers.pending_c_parser before_each(clear) @@ -12,7 +11,6 @@ describe('treesitter utils', function() before_each(clear) it('can find an ancestor', function() - if pending_c_parser(pending) then return end insert([[ int main() { |