aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2020-09-06 13:19:12 +0200
committerGitHub <noreply@github.com>2020-09-06 13:19:12 +0200
commit01b46013762f4dc6df30e048dc4c5dc51c128794 (patch)
tree74bb77fb03aad0f9470c912f55e0b4e35c6be59c /test
parent280ee90f24050ae57d8ffac7a90d4cd45b58ee56 (diff)
parent9c929e7d23b8eaf3ff57dbbe9346abc4430e7669 (diff)
downloadrneovim-01b46013762f4dc6df30e048dc4c5dc51c128794.tar.gz
rneovim-01b46013762f4dc6df30e048dc4c5dc51c128794.tar.bz2
rneovim-01b46013762f4dc6df30e048dc4c5dc51c128794.zip
Merge pull request #12826 from vigoux/ts-lua-match
treesitter: use lua-match? instead of match?
Diffstat (limited to 'test')
-rw-r--r--test/functional/lua/treesitter_spec.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/test/functional/lua/treesitter_spec.lua b/test/functional/lua/treesitter_spec.lua
index c041478af6..5bca42a4fc 100644
--- a/test/functional/lua/treesitter_spec.lua
+++ b/test/functional/lua/treesitter_spec.lua
@@ -250,13 +250,13 @@ void ui_refresh(void)
}, res)
end)
- it('allow loading query with escaped quotes and capture them with `match?` and `vim-match?`', function()
+ it('allow loading query with escaped quotes and capture them with `lua-match?` and `vim-match?`', function()
if not check_parser() then return end
insert('char* astring = "Hello World!";')
local res = exec_lua([[
- cquery = vim.treesitter.parse_query("c", '((_) @quote (vim-match? @quote "^\\"$")) ((_) @quote (match? @quote "^\\"$"))')
+ cquery = vim.treesitter.parse_query("c", '((_) @quote (vim-match? @quote "^\\"$")) ((_) @quote (lua-match? @quote "^\\"$"))')
parser = vim.treesitter.get_parser(0, "c")
tree = parser:parse()
res = {}
@@ -323,7 +323,7 @@ void ui_refresh(void)
return list
]]
- eq({ 'contains?', 'eq?', 'is-main?', 'match?', 'vim-match?' }, res_list)
+ eq({ 'contains?', 'eq?', 'is-main?', 'lua-match?', 'match?', 'vim-match?' }, res_list)
end)
it('supports highlighting', function()
@@ -373,7 +373,7 @@ static int nlua_schedule(lua_State *const lstate)
; Use lua regexes
((identifier) @Identifier (#contains? @Identifier "lua_"))
-((identifier) @Constant (#match? @Constant "^[A-Z_]+$"))
+((identifier) @Constant (#lua-match? @Constant "^[A-Z_]+$"))
((identifier) @Normal (#vim-match? @Constant "^lstate$"))
((binary_expression left: (identifier) @WarningMsg.left right: (identifier) @WarningMsg.right) (#eq? @WarningMsg.left @WarningMsg.right))