aboutsummaryrefslogtreecommitdiff
path: root/test/functional/treesitter
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2025-02-26 14:31:03 -0800
committerGitHub <noreply@github.com>2025-02-26 14:31:03 -0800
commit4f42b69b4ad0d0034581d756ef9bcb0e55f3491d (patch)
tree0c40b6f8c3569e339d375cb5842820590c5f3103 /test/functional/treesitter
parentf4921e2b7deb4812414998a521c33f920f571c20 (diff)
parent4a997a1732fdb7a1c99cadf780b789f1ac84d990 (diff)
downloadrneovim-4f42b69b4ad0d0034581d756ef9bcb0e55f3491d.tar.gz
rneovim-4f42b69b4ad0d0034581d756ef9bcb0e55f3491d.tar.bz2
rneovim-4f42b69b4ad0d0034581d756ef9bcb0e55f3491d.zip
Merge #32601 vim.text.indent()
Diffstat (limited to 'test/functional/treesitter')
-rw-r--r--test/functional/treesitter/highlight_spec.lua16
-rw-r--r--test/functional/treesitter/node_spec.lua4
-rw-r--r--test/functional/treesitter/query_spec.lua28
3 files changed, 24 insertions, 24 deletions
diff --git a/test/functional/treesitter/highlight_spec.lua b/test/functional/treesitter/highlight_spec.lua
index 6d59368a24..f3a321aa88 100644
--- a/test/functional/treesitter/highlight_spec.lua
+++ b/test/functional/treesitter/highlight_spec.lua
@@ -786,9 +786,9 @@ describe('treesitter highlighting (C)', function()
screen:expect({
grid = [[
- {26:int x = 4;} |
- {26:int y = 5;} |
- {26:int z = 6;} |
+ {26:int x = 4;} |
+ {26:int y = 5;} |
+ {26:int z = 6;} |
^ |
{1:~ }|*13
|
@@ -815,7 +815,7 @@ describe('treesitter highlighting (C)', function()
screen:expect({
grid = [[
- void foo(int {15:*}{25:bar}); |
+ void foo(int {15:*}{25:bar}); |
^ |
{1:~ }|*15
|
@@ -883,8 +883,8 @@ describe('treesitter highlighting (lua)', function()
screen:expect({
grid = [[
- {15:local} {25:ffi} {15:=} {16:require(}{26:'ffi'}{16:)} |
- {25:ffi}{16:.}{25:cdef}{16:(}{26:"}{16:int}{26: }{16:(}{15:*}{26:fun}{16:)(int,}{26: }{16:char}{26: }{15:*}{16:);}{26:"}{16:)} |
+ {15:local} {25:ffi} {15:=} {16:require(}{26:'ffi'}{16:)} |
+ {25:ffi}{16:.}{25:cdef}{16:(}{26:"}{16:int}{26: }{16:(}{15:*}{26:fun}{16:)(int,}{26: }{16:char}{26: }{15:*}{16:);}{26:"}{16:)} |
^ |
{1:~ }|*14
|
@@ -1185,7 +1185,7 @@ printf('Hello World!');
{18:```}{15:c} |
{25:printf}{16:(}{26:'Hello World!'}{16:);} |
{18:```} |
- ^ |
+ ^ |
|
]],
})
@@ -1271,7 +1271,7 @@ printf('Hello World!');
{8:120 }{25:printf}{16:(}{26:'Hello World!'}{16:);} |
{8:122 } |
{8:124 }{25:printf}{16:(}{26:'Hello World!'}{16:);} |
- {8:126 } ^ |
+ {8:126 }^ |
|
]])
end)
diff --git a/test/functional/treesitter/node_spec.lua b/test/functional/treesitter/node_spec.lua
index 2a1fa497af..2f6f810ef2 100644
--- a/test/functional/treesitter/node_spec.lua
+++ b/test/functional/treesitter/node_spec.lua
@@ -82,7 +82,7 @@ describe('treesitter node API', function()
]])
exec_lua(function()
- local parser = vim.treesitter.get_parser(0, 'c')
+ local parser = assert(vim.treesitter.get_parser(0, 'c'))
local tree = parser:parse()[1]
_G.root = tree:root()
vim.treesitter.language.inspect('c')
@@ -92,7 +92,7 @@ describe('treesitter node API', function()
end
end)
- exec_lua 'node = root:descendant_for_range(0, 11, 0, 16)'
+ exec_lua 'node = root:descendant_for_range(0, 9, 0, 14)'
eq('int x', lua_eval('node_text(node)'))
exec_lua 'node = node:next_sibling()'
diff --git a/test/functional/treesitter/query_spec.lua b/test/functional/treesitter/query_spec.lua
index 6db0ffe5a0..be9c60b8ad 100644
--- a/test/functional/treesitter/query_spec.lua
+++ b/test/functional/treesitter/query_spec.lua
@@ -386,8 +386,8 @@ void ui_refresh(void)
[[((primitive_type) @c-keyword (#any-of? @c-keyword "int" "float"))]]
)
eq({
- { 'c-keyword', 'primitive_type', { 2, 2, 2, 5 }, 'int' },
- { 'c-keyword', 'primitive_type', { 3, 4, 3, 7 }, 'int' },
+ { 'c-keyword', 'primitive_type', { 2, 0, 2, 3 }, 'int' },
+ { 'c-keyword', 'primitive_type', { 3, 2, 3, 5 }, 'int' },
}, res0)
local res1 = exec_lua(
@@ -401,9 +401,9 @@ void ui_refresh(void)
]]
)
eq({
- { 'fizzbuzz-strings', 'string_literal', { 6, 15, 6, 38 }, '"number= %d FizzBuzz\\n"' },
- { 'fizzbuzz-strings', 'string_literal', { 8, 15, 8, 34 }, '"number= %d Fizz\\n"' },
- { 'fizzbuzz-strings', 'string_literal', { 10, 15, 10, 34 }, '"number= %d Buzz\\n"' },
+ { 'fizzbuzz-strings', 'string_literal', { 6, 13, 6, 36 }, '"number= %d FizzBuzz\\n"' },
+ { 'fizzbuzz-strings', 'string_literal', { 8, 13, 8, 32 }, '"number= %d Fizz\\n"' },
+ { 'fizzbuzz-strings', 'string_literal', { 10, 13, 10, 32 }, '"number= %d Buzz\\n"' },
}, res1)
end)
@@ -608,9 +608,9 @@ void ui_refresh(void)
eq(
{
- { 0, 2, 0, 8 },
- { 1, 2, 1, 8 },
- { 2, 2, 2, 8 },
+ { 0, 0, 0, 6 },
+ { 1, 0, 1, 6 },
+ { 2, 0, 2, 6 },
},
test(
[[
@@ -636,9 +636,9 @@ void ui_refresh(void)
eq(
{
- { 0, 2, 0, 7 },
- { 1, 2, 1, 8 },
- { 2, 2, 2, 7 },
+ { 0, 0, 0, 5 },
+ { 1, 0, 1, 6 },
+ { 2, 0, 2, 5 },
},
test(
[[
@@ -675,9 +675,9 @@ void ui_refresh(void)
end)
eq({
- { 0, 2, 0, 12 },
- { 1, 2, 1, 12 },
- { 2, 2, 2, 12 },
+ { 0, 0, 0, 10 },
+ { 1, 0, 1, 10 },
+ { 2, 0, 2, 10 },
}, result)
end)