mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
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
This commit is contained in:
@@ -40,13 +40,7 @@ describe('cmdline', function()
|
||||
screen:expect{grid=[[
|
||||
{1: + [No Name] }{2: [No Name] }{3: }{1:X}|
|
||||
^ |
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{4:~ }|*7
|
||||
:tabnew |
|
||||
]]}
|
||||
|
||||
@@ -54,14 +48,8 @@ describe('cmdline', function()
|
||||
screen:expect{grid=[[
|
||||
{1: + [No Name] }{2: [No Name] }{3: }{1:X}|
|
||||
^ |
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
|
|
||||
|
|
||||
|
|
||||
{4:~ }|*5
|
||||
|*3
|
||||
]]}
|
||||
|
||||
feed [[gt]]
|
||||
@@ -82,14 +70,8 @@ describe('cmdline', function()
|
||||
screen:expect([[
|
||||
{1: + [No Name] }{2: [No Name] }{3: }{1:X}|
|
||||
^ |
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
{4:~ }|
|
||||
|
|
||||
|
|
||||
|
|
||||
{4:~ }|*5
|
||||
|*3
|
||||
]])
|
||||
end)
|
||||
|
||||
@@ -105,8 +87,7 @@ describe('cmdline', function()
|
||||
feed_command('DoSomething')
|
||||
screen:expect([[
|
||||
|
|
||||
~ |
|
||||
~ |
|
||||
~ |*2
|
||||
|
|
||||
Executing: DoSomething |
|
||||
Executing: echo 'hello' |set ts=4 |let v = '123' |echo v |
|
||||
@@ -135,9 +116,7 @@ describe('cmdline', function()
|
||||
screen:expect([[
|
||||
{1:foo }|
|
||||
|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|*3
|
||||
:^ |
|
||||
]])
|
||||
end)
|
||||
@@ -156,9 +135,7 @@ describe('cmdline', function()
|
||||
feed(':for i in range(3)<CR>')
|
||||
screen:expect([[
|
||||
|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|*3
|
||||
:for i in range(3) |
|
||||
: ^ |
|
||||
]])
|
||||
@@ -166,9 +143,7 @@ describe('cmdline', function()
|
||||
-- Note: this may still be considered broken, ref #18140
|
||||
screen:expect([[
|
||||
|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|*3
|
||||
: :let i =^ |
|
||||
|
|
||||
]])
|
||||
@@ -194,22 +169,14 @@ describe('cmdline', function()
|
||||
feed(':call EchoTwo()')
|
||||
screen:expect([[
|
||||
|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|*5
|
||||
{1:[No Name] }|
|
||||
:call EchoTwo()^ |
|
||||
]])
|
||||
feed('<CR>')
|
||||
screen:expect([[
|
||||
^ |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|*5
|
||||
{1:[No Name] }|
|
||||
|
|
||||
]])
|
||||
@@ -231,10 +198,7 @@ describe('cmdline', function()
|
||||
screen:expect([[
|
||||
{2: [No Name] }{3: }|
|
||||
^ |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|*4
|
||||
{1:[No Name] }|
|
||||
|
|
||||
]])
|
||||
@@ -281,58 +245,27 @@ describe('cmdwin', function()
|
||||
feed('q')
|
||||
screen:expect([[
|
||||
|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|*5
|
||||
{2:[No Name] }|
|
||||
{0::}^ |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|*6
|
||||
{1:[Command Line] }|
|
||||
|
|
||||
]])
|
||||
feed([[aecho 'done']])
|
||||
screen:expect([[
|
||||
|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|*5
|
||||
{2:[No Name] }|
|
||||
{0::}echo 'done'^ |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|*6
|
||||
{1:[Command Line] }|
|
||||
{4:-- INSERT --} |
|
||||
]])
|
||||
feed('<CR>')
|
||||
screen:expect([[
|
||||
^ |
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|
|
||||
{0:~ }|*14
|
||||
done |
|
||||
]])
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user