aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/bufhl_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/ui/bufhl_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/ui/bufhl_spec.lua')
-rw-r--r--test/functional/ui/bufhl_spec.lua255
1 files changed, 59 insertions, 196 deletions
diff --git a/test/functional/ui/bufhl_spec.lua b/test/functional/ui/bufhl_spec.lua
index 81e514c9aa..f7b8144ff9 100644
--- a/test/functional/ui/bufhl_spec.lua
+++ b/test/functional/ui/bufhl_spec.lua
@@ -51,11 +51,7 @@ describe('Buffer highlighting', function()
screen:expect([[
these are some lines |
with colorful tex^t |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
@@ -65,11 +61,7 @@ describe('Buffer highlighting', function()
screen:expect([[
these are {2:some} lines |
with {3:colorful tex^t} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
@@ -78,10 +70,7 @@ describe('Buffer highlighting', function()
these are {2:some} lines |
^ |
with {3:colorful text} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
@@ -90,10 +79,7 @@ describe('Buffer highlighting', function()
these are some lines |
^ |
with colorful text |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end)
@@ -129,9 +115,7 @@ describe('Buffer highlighting', function()
in {6:order} to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} source^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
end)
@@ -143,9 +127,7 @@ describe('Buffer highlighting', function()
in {6:order} to de{4:monstr}ate |
combin{9:ing hi}ghlights |
{9:from diff}erent source^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
end)
@@ -157,9 +139,7 @@ describe('Buffer highlighting', function()
in {6:order} to de{4:monstr}ate |
combin{9:ing hi}ghlights |
{9:from diff}erent source^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
end)
@@ -171,9 +151,7 @@ describe('Buffer highlighting', function()
in order to {7:demonstrate} |
{7:combining} highlights |
from {7:different} source^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
end)
@@ -187,9 +165,7 @@ describe('Buffer highlighting', function()
in {6:order} to de{4:monstr}ate |
{7:combining} highlights |
from {7:different} source^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
end)
@@ -201,9 +177,7 @@ describe('Buffer highlighting', function()
^ |
in {6:order} to {7:de}{5:monstr}{7:ate} |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]])
@@ -216,9 +190,7 @@ describe('Buffer highlighting', function()
|
{8:from different sources} |
{8:^in }{20:order}{8: to demonstrate} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
--screen:expect([[
@@ -226,9 +198,7 @@ describe('Buffer highlighting', function()
-- |
-- {9:from }{8:diff}{7:erent} sources |
-- ^in {6:order} to {7:de}{5:monstr}{7:ate} |
- -- {1:~ }|
- -- {1:~ }|
- -- {1:~ }|
+ -- {1:~ }|*3
-- |
--]])
@@ -238,9 +208,7 @@ describe('Buffer highlighting', function()
^ |
in {6:order} to {7:de}{5:monstr}{7:ate} |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
1 change; before #4 {MATCH:.*}|
]]}
@@ -249,10 +217,7 @@ describe('Buffer highlighting', function()
^a {5:longer} example |
in {6:order} to {7:de}{5:monstr}{7:ate} |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
1 line less; before #3 {MATCH:.*}|
]]}
@@ -262,9 +227,7 @@ describe('Buffer highlighting', function()
in {6:order} to {7:de}{5:monstr}{7:ate} |
{7:^combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
1 more line; before #2 {MATCH:.*}|
]]}
end)
@@ -276,9 +239,7 @@ describe('Buffer highlighting', function()
{7:combin}{8:ing}{9: hi}ghlights |
^in {6:order} to {7:de}{5:monstr}{7:ate} |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -288,9 +249,7 @@ describe('Buffer highlighting', function()
{9:from }{8:diff}{7:erent} sources |
a {5:longer} example |
{7:^combin}{8:ing}{9: hi}ghlights |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -300,9 +259,7 @@ describe('Buffer highlighting', function()
{7:combin}{8:ing}{9: hi}ghlights |
^in {6:order} to {7:de}{5:monstr}{7:ate} |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
2 changes; before #3 {MATCH:.*}|
]]}
@@ -312,9 +269,7 @@ describe('Buffer highlighting', function()
^in {6:order} to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
1 change; before #2 {MATCH:.*}|
]]}
end)
@@ -327,9 +282,7 @@ describe('Buffer highlighting', function()
in {6:order} to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -339,9 +292,7 @@ describe('Buffer highlighting', function()
in {6:order} to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
1 change; before #2 {MATCH:.*}|
]]}
@@ -352,9 +303,7 @@ describe('Buffer highlighting', function()
in {6:ordAAAA^r} to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{7:-- INSERT --} |
]]}
@@ -364,9 +313,7 @@ describe('Buffer highlighting', function()
in {6:ordAAAAr} t^o |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
@@ -376,9 +323,7 @@ describe('Buffer highlighting', function()
in {6:ordAAAAr} to^ {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
1 change; before #4 {MATCH:.*}|
]]}
@@ -388,9 +333,7 @@ describe('Buffer highlighting', function()
in {6:ord^er} to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
1 change; before #3 {MATCH:.*}|
]]}
end)
@@ -401,10 +344,7 @@ describe('Buffer highlighting', function()
a {5:longer} example in {6:order} to {7:de}{5:monstr}{7:ate}|
{7:combin}{8:ing}{9: hi}ghlights^ {9:from }{8:diff}{7:erent} sou|
rces |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]]}
@@ -414,9 +354,7 @@ describe('Buffer highlighting', function()
in {6:order} to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
1 more line; before #2 {MATCH:.*}|
]]}
end)
@@ -429,8 +367,7 @@ describe('Buffer highlighting', function()
^ to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{7:-- INSERT --} |
]]}
@@ -453,8 +390,7 @@ describe('Buffer highlighting', function()
to {7:de}{5:mo^nstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
1 line less; before #3 {MATCH:.*}|
]]}
@@ -464,9 +400,7 @@ describe('Buffer highlighting', function()
in {6:order}^ to {7:de}{5:monstr}{7:ate} |
{7:combin}{8:ing}{9: hi}ghlights |
{9:from }{8:diff}{7:erent} sources |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
1 line less; before #2 {MATCH:.*}|
]]}
end)
@@ -481,24 +415,14 @@ describe('Buffer highlighting', function()
screen:expect([[
{4:three ove}{6:rlapp}{2:ing color}^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
clear_namespace(id, 0, 1)
screen:expect([[
three {6:overlapp}{2:ing color}^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
end)
@@ -512,24 +436,14 @@ describe('Buffer highlighting', function()
screen:expect{grid=[[
{4:three }{6:overlapp}{2:ing color}^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]]}
clear_namespace(id, 0, 1)
screen:expect{grid=[[
three {6:overlapp}{2:ing color}^s |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]]}
end)
@@ -554,24 +468,14 @@ describe('Buffer highlighting', function()
screen:expect [[
{3:fooba}{2:^r} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]]
clear_namespace(id, 0, -1)
screen:expect{grid=[[
fooba^r |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]]}
@@ -590,12 +494,7 @@ describe('Buffer highlighting', function()
screen:expect [[
{3:fooba}{2:^r} |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]]
end)
@@ -608,12 +507,7 @@ describe('Buffer highlighting', function()
screen:expect([[
Ta {6:båten} över {2:sjön}^! |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
end)
@@ -624,24 +518,14 @@ describe('Buffer highlighting', function()
add_highlight(-1, "FancyLangItem", 0, 0, 5)
screen:expect([[
fancy code in a new fancy languag^e |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
command('hi FancyLangItem guifg=red')
screen:expect([[
{10:fancy} code in a new fancy languag^e |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*6
|
]])
end)
@@ -661,8 +545,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, |
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -680,8 +563,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -692,8 +574,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -706,8 +587,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -718,8 +598,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -732,9 +611,7 @@ describe('Buffer highlighting', function()
^5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, {12:暗x事zz速野谷質結育}|
x = 4 |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
|
]]}
--screen:expect([[
@@ -742,9 +619,7 @@ describe('Buffer highlighting', function()
-- ^5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
-- , 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
-- x = 4 |
- -- {1:~ }|
- -- {1:~ }|
- -- {1:~ }|
+ -- {1:~ }|*3
-- |
--]])
end)
@@ -796,8 +671,7 @@ describe('Buffer highlighting', function()
{13:5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5}|
{13:, 5, 5, 5, 5, 5, 5, } Lorem ipsum dolor s|
^x{13: = 4} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{7:-- VISUAL LINE --} |
]])
@@ -808,8 +682,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
^x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -821,8 +694,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -833,8 +705,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{7:-- VISUAL --} |
]])
@@ -845,8 +716,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
{7:-- VISUAL --} |
]])
end)
@@ -860,8 +730,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5,{1:-$}Lorem ipsum dolor s|
x = 4{1:$} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
@@ -872,8 +741,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5,{1:-$} |
x = 4{1:$} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]])
end)
@@ -887,8 +755,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -899,8 +766,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -912,8 +778,7 @@ describe('Buffer highlighting', function()
{14:^5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5}|
{14:, 5, 5, 5, 5, 5, 5, }Lorem ipsum dolor s|
x = 4 |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
end)
@@ -926,8 +791,7 @@ describe('Buffer highlighting', function()
5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 {12:暗x事} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
@@ -938,8 +802,7 @@ describe('Buffer highlighting', function()
5, 5, 5,{18: }5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5|
, 5, 5, 5, 5, 5, 5, Lorem ipsum dolor s|
x = 4 {12:暗x事} |
- {1:~ }|
- {1:~ }|
+ {1:~ }|*2
|
]]}
end)