mirror of
https://github.com/neovim/neovim.git
synced 2025-12-06 14:42:35 +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:
@@ -89,9 +89,7 @@ describe('input()', function()
|
||||
command('redraw!')
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:Foo}^ |
|
||||
]])
|
||||
end)
|
||||
@@ -100,17 +98,13 @@ describe('input()', function()
|
||||
feed([[:call input(1, 2)<CR>]])
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:1}2^ |
|
||||
]])
|
||||
feed('<BS>')
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:1}^ |
|
||||
]])
|
||||
end)
|
||||
@@ -120,25 +114,19 @@ describe('input()', function()
|
||||
feed([[:echo input(opts)<CR>]])
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:1}2^ |
|
||||
]])
|
||||
feed('<BS>')
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:1}^ |
|
||||
]])
|
||||
feed('<Esc>')
|
||||
screen:expect([[
|
||||
^ |
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:3} |
|
||||
]])
|
||||
end)
|
||||
@@ -148,33 +136,25 @@ describe('input()', function()
|
||||
feed([[:echo inputdialog(opts)<CR>]])
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:Foo>}Bar^ |
|
||||
]])
|
||||
command('mode')
|
||||
screen:expect{grid=[[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:Foo>}Bar^ |
|
||||
]], reset=true}
|
||||
feed('<BS>')
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:Foo>}Ba^ |
|
||||
]])
|
||||
command('mode')
|
||||
screen:expect{grid=[[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:Foo>}Ba^ |
|
||||
]], reset=true}
|
||||
end)
|
||||
@@ -183,9 +163,7 @@ describe('input()', function()
|
||||
feed([[:call input({})<CR>]])
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
^ |
|
||||
]])
|
||||
end)
|
||||
@@ -245,9 +223,7 @@ describe('input()', function()
|
||||
feed('(())')
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{RBP1:(}{RBP2:()}{RBP1:)}^ |
|
||||
]])
|
||||
end)
|
||||
@@ -294,9 +270,7 @@ describe('inputdialog()', function()
|
||||
command('redraw!')
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:Foo}^ |
|
||||
]])
|
||||
end)
|
||||
@@ -305,17 +279,13 @@ describe('inputdialog()', function()
|
||||
feed([[:call inputdialog(1, 2)<CR>]])
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:1}2^ |
|
||||
]])
|
||||
feed('<BS>')
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:1}^ |
|
||||
]])
|
||||
end)
|
||||
@@ -325,25 +295,19 @@ describe('inputdialog()', function()
|
||||
feed([[:echo input(opts)<CR>]])
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:1}2^ |
|
||||
]])
|
||||
feed('<BS>')
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:1}^ |
|
||||
]])
|
||||
feed('<Esc>')
|
||||
screen:expect([[
|
||||
^ |
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:3} |
|
||||
]])
|
||||
end)
|
||||
@@ -353,33 +317,25 @@ describe('inputdialog()', function()
|
||||
feed([[:echo input(opts)<CR>]])
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:Foo>}Bar^ |
|
||||
]])
|
||||
command('mode')
|
||||
screen:expect{grid=[[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:Foo>}Bar^ |
|
||||
]], reset=true}
|
||||
feed('<BS>')
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:Foo>}Ba^ |
|
||||
]])
|
||||
command('mode')
|
||||
screen:expect{grid=[[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{T:Foo>}Ba^ |
|
||||
]], reset=true}
|
||||
end)
|
||||
@@ -388,9 +344,7 @@ describe('inputdialog()', function()
|
||||
feed(':echo inputdialog({})<CR>')
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
^ |
|
||||
]])
|
||||
end)
|
||||
@@ -441,9 +395,7 @@ describe('inputdialog()', function()
|
||||
feed('(())')
|
||||
screen:expect([[
|
||||
|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|
|
||||
{EOB:~ }|*3
|
||||
{RBP1:(}{RBP2:()}{RBP1:)}^ |
|
||||
]])
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user