diff options
Diffstat (limited to 'test/functional/treesitter/language_spec.lua')
-rw-r--r-- | test/functional/treesitter/language_spec.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/functional/treesitter/language_spec.lua b/test/functional/treesitter/language_spec.lua index 0e18a36352..365e2a697a 100644 --- a/test/functional/treesitter/language_spec.lua +++ b/test/functional/treesitter/language_spec.lua @@ -120,6 +120,20 @@ describe('treesitter language API', function() eq('<node translation_unit>', exec_lua('return tostring(tree:root())')) end) + it('retrieve the tree given a range when range is out of bounds relative to buffer', function() + insert([[ + int main() { + int x = 3; + }]]) + + exec_lua([[ + langtree = vim.treesitter.get_parser(0, "c") + tree = langtree:tree_for_range({10, 10, 10, 10}) + ]]) + + eq('<node translation_unit>', exec_lua('return tostring(tree:root())')) + end) + it('retrieve the node given a range', function() insert([[ int main() { |