aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/treesitter/node_spec.lua14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/treesitter/node_spec.lua b/test/functional/treesitter/node_spec.lua
index 72508ba958..eef75d0e91 100644
--- a/test/functional/treesitter/node_spec.lua
+++ b/test/functional/treesitter/node_spec.lua
@@ -26,6 +26,20 @@ describe('treesitter node API', function()
assert_alive()
end)
+ it('double free tree 2', function()
+ exec_lua([[
+ parser = vim.treesitter.get_parser(0, "c")
+ local x = parser:parse()[1]:root():tree()
+ vim.api.nvim_buf_set_text(0, 0,0, 0,0, {'y'})
+ parser:parse()
+ vim.api.nvim_buf_set_text(0, 0,0, 0,1, {'z'})
+ parser:parse()
+ collectgarbage()
+ x:root()
+ ]])
+ assert_alive()
+ end)
+
it('can move between siblings', function()
insert([[
int main(int x, int y, int z) {