aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/lsp/semantic_tokens_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-12-09 20:42:00 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-12-09 22:15:02 +0800
commit1037ce2e461034a20e35ad59969fd05d5ad68b91 (patch)
tree5cc490afac4607008bacf24d132015b63adfd1d0 /test/functional/plugin/lsp/semantic_tokens_spec.lua
parent5e43630a260e49ed494539d41cb832b1ee6d03c8 (diff)
downloadrneovim-1037ce2e461034a20e35ad59969fd05d5ad68b91.tar.gz
rneovim-1037ce2e461034a20e35ad59969fd05d5ad68b91.tar.bz2
rneovim-1037ce2e461034a20e35ad59969fd05d5ad68b91.zip
test: avoid repeated screen lines in expected states
This is the command invoked repeatedly to make the changes: :%s/^\(.*\)|\%(\*\(\d\+\)\)\?$\n\1|\%(\*\(\d\+\)\)\?$/\=submatch(1)..'|*'..(max([str2nr(submatch(2)),1])+max([str2nr(submatch(3)),1]))/g
Diffstat (limited to 'test/functional/plugin/lsp/semantic_tokens_spec.lua')
-rw-r--r--test/functional/plugin/lsp/semantic_tokens_spec.lua175
1 files changed, 26 insertions, 149 deletions
diff --git a/test/functional/plugin/lsp/semantic_tokens_spec.lua b/test/functional/plugin/lsp/semantic_tokens_spec.lua
index b7ac53f270..b95d435c2b 100644
--- a/test/functional/plugin/lsp/semantic_tokens_spec.lua
+++ b/test/functional/plugin/lsp/semantic_tokens_spec.lua
@@ -125,9 +125,7 @@ describe('semantic token highlighting', function()
{6:#endif} |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
end)
@@ -164,9 +162,7 @@ describe('semantic token highlighting', function()
{6:#endif} |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
@@ -199,9 +195,7 @@ describe('semantic token highlighting', function()
#endif |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
end)
@@ -234,9 +228,7 @@ describe('semantic token highlighting', function()
#endif |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
@@ -257,9 +249,7 @@ describe('semantic token highlighting', function()
{6:#endif} |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
end)
@@ -286,9 +276,7 @@ describe('semantic token highlighting', function()
{6:#endif} |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
@@ -309,9 +297,7 @@ describe('semantic token highlighting', function()
{6:#endif} |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], unchanged = true }
@@ -365,9 +351,7 @@ describe('semantic token highlighting', function()
{6:#endif} |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
feed_command('%s/int x/int x()/')
@@ -383,11 +367,8 @@ describe('semantic token highlighting', function()
{6:#else} |
{6: printf("%d\n", x);} |
{6:#endif} |
- } |
- } |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ } |*2
+ {1:~ }|*3
:noh |
]] }
end)
@@ -447,9 +428,7 @@ describe('semantic token highlighting', function()
#endif |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
@@ -474,9 +453,7 @@ describe('semantic token highlighting', function()
#endif |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]], unchanged = true }
end)
@@ -520,9 +497,7 @@ describe('semantic token highlighting', function()
#endif |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
end)
@@ -565,9 +540,7 @@ describe('semantic token highlighting', function()
{6:#endif} |
} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]] }
feed_command('%s/int x/int x()/')
@@ -587,11 +560,8 @@ describe('semantic token highlighting', function()
{6:#else} |
{6: printf("%d\n", x);} |
{6:#endif} |
- } |
- } |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ } |*2
+ {1:~ }|*3
:noh |
]] }
local messages = exec_lua('return server2.messages')
@@ -633,20 +603,7 @@ describe('semantic token highlighting', function()
expected_screen = function()
screen:expect{grid=[[
char* {7:foo} = "\n"^; |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*14
|
]]}
end,
@@ -774,11 +731,7 @@ int main()
{6: comment} |
{6: #endif} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]]}
end,
@@ -828,18 +781,7 @@ b = "as"]],
{6:-- comment} |
local {7:a} = 1 |
{2:b} = "as^" |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*12
|
]]}
end,
@@ -960,16 +902,7 @@ b = "as"]],
//{6:/ what?} |
} |
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*10
|
]]}
end,
@@ -1055,20 +988,7 @@ b = "as"]],
expected_screen1 = function()
screen:expect{grid=[[
char* {7:foo} = "\n"^; |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*14
|
]]}
end,
@@ -1076,19 +996,7 @@ b = "as"]],
screen:expect{grid=[[
^ |
char* {7:foo} = "\n"; |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*13
|
]]}
end,
@@ -1304,10 +1212,7 @@ int main()
{6: printf("%d\n", x);} |
{6:#endif} |
^} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]]}
end,
@@ -1325,9 +1230,7 @@ int main()
{6: printf("%d\n", x);} |
{6:^#endif} |
} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
end,
@@ -1363,40 +1266,14 @@ int main()
expected_screen1 = function()
screen:expect{grid=[[
{7:string} = "test^" |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*14
|
]]}
end,
expected_screen2 = function()
screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*14
|
]]}
end,