aboutsummaryrefslogtreecommitdiff
path: root/test/functional/treesitter/highlight_spec.lua
diff options
context:
space:
mode:
authorChristian Clason <c.clason@uni-graz.at>2023-04-01 12:11:24 +0200
committerChristian Clason <c.clason@uni-graz.at>2023-04-01 12:19:15 +0200
commit90fdaf55c913d07bc80eec6442b02d8c001659b4 (patch)
tree6d6e18b4e84a227526a5c9551476686d387eba8e /test/functional/treesitter/highlight_spec.lua
parentdee559d7440e3048790c6798bdb5ed89f8cdea30 (diff)
downloadrneovim-90fdaf55c913d07bc80eec6442b02d8c001659b4.tar.gz
rneovim-90fdaf55c913d07bc80eec6442b02d8c001659b4.tar.bz2
rneovim-90fdaf55c913d07bc80eec6442b02d8c001659b4.zip
fix(tests): adapt treesitter/highlight_spec priority test
Still relied on the old `@Foo`->`Foo` capture to highlight mechanism; use capture with default highlight instead.
Diffstat (limited to 'test/functional/treesitter/highlight_spec.lua')
-rw-r--r--test/functional/treesitter/highlight_spec.lua16
1 files changed, 8 insertions, 8 deletions
diff --git a/test/functional/treesitter/highlight_spec.lua b/test/functional/treesitter/highlight_spec.lua
index 44e6500008..faeb4befcd 100644
--- a/test/functional/treesitter/highlight_spec.lua
+++ b/test/functional/treesitter/highlight_spec.lua
@@ -575,14 +575,14 @@ describe('treesitter highlighting', function()
exec_lua [[
local parser = vim.treesitter.get_parser(0, "c")
- test_hl = vim.treesitter.highlighter.new(parser, {queries = {c = hl_query..'\n((translation_unit) @Error (set! "priority" 101))\n'}})
+ test_hl = vim.treesitter.highlighter.new(parser, {queries = {c = hl_query..'\n((translation_unit) @constant (#set! "priority" 101))\n'}})
]]
- -- expect everything to have Error highlight
+ -- expect everything to have Constant highlight
screen:expect{grid=[[
{12:int}{8: x = INT_MAX;} |
- {8:#define READ_STRING(x, y) (}{12:char_u}{8: *)read_string((x), (}{12:size_t}{8:)(y))}|
- {8:#define foo }{12:void}{8: main() { \} |
- {8: }{12:return}{8: 42; \} |
+ {8:#define READ_STRING(x, y) (char_u *)read_string((x), (size_t)(y))}|
+ {8:#define foo void main() { \} |
+ {8: return 42; \} |
{8: }} |
^ |
{1:~ }|
@@ -599,13 +599,13 @@ describe('treesitter highlighting', function()
|
]], attr_ids={
[1] = {bold = true, foreground = Screen.colors.Blue1};
- [8] = {foreground = Screen.colors.Grey100, background = Screen.colors.Red};
+ [8] = {foreground = Screen.colors.Magenta1};
-- bold will not be overwritten at the moment
- [12] = {background = Screen.colors.Red, bold = true, foreground = Screen.colors.Grey100};
+ [12] = {bold = true, foreground = Screen.colors.Magenta1};
}}
eq({
- {capture='Error', metadata = { priority='101' }, lang='c' };
+ {capture='constant', metadata = { priority='101' }, lang='c' };
{capture='type', metadata = { }, lang='c' };
}, exec_lua [[ return vim.treesitter.get_captures_at_pos(0, 0, 2) ]])
end)