test: support upvalues in exec_lua

This commit is contained in:
Lewis Russell
2024-08-11 09:27:48 +01:00
committed by Lewis Russell
parent a19e89022d
commit e5c174421d
34 changed files with 1740 additions and 1362 deletions

View File

@@ -166,10 +166,10 @@ describe('treesitter language API', function()
it('retrieve an anonymous node given a range', function()
insert([[vim.fn.input()]])
exec_lua([[
langtree = vim.treesitter.get_parser(0, "lua")
node = langtree:node_for_range({0, 3, 0, 3})
]])
exec_lua(function()
_G.langtree = vim.treesitter.get_parser(0, 'lua')
_G.node = _G.langtree:node_for_range({ 0, 3, 0, 3 })
end)
eq('.', exec_lua('return node:type()'))
end)