diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/treesitter/node_spec.lua | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/functional/treesitter/node_spec.lua b/test/functional/treesitter/node_spec.lua index 5ff73d3a8d..72508ba958 100644 --- a/test/functional/treesitter/node_spec.lua +++ b/test/functional/treesitter/node_spec.lua @@ -4,6 +4,7 @@ local clear = helpers.clear local eq = helpers.eq local exec_lua = helpers.exec_lua local insert = helpers.insert +local assert_alive = helpers.assert_alive before_each(clear) @@ -14,6 +15,17 @@ end describe('treesitter node API', function() clear() + it('double free tree', function() + insert('F') + exec_lua([[ + vim.treesitter.start(0, 'lua') + vim.treesitter.get_node():tree() + vim.treesitter.get_node():tree() + collectgarbage() + ]]) + assert_alive() + end) + it('can move between siblings', function() insert([[ int main(int x, int y, int z) { |