functests: Get rid of last redraws due to the “line above” issue

This commit is contained in:
ZyX 2017-05-11 12:15:41 +03:00
parent 33ca9f711e
commit b6d73fb740

View File

@ -79,8 +79,9 @@ describe('input()', function()
]])
end)
it('works correctly with multiple numeric arguments (dict arg)', function()
feed([[:echohl Test | echo input({"prompt": 1, "default": 2, "cancelreturn": 3})<CR>]])
command('redraw!') -- Without this it shows `12` on the line above.
command('echohl Test')
meths.set_var('opts', {prompt=1, default=2, cancelreturn=3})
feed([[:echo input(opts)<CR>]])
screen:expect([[
|
{EOB:~ }|
@ -105,6 +106,42 @@ describe('input()', function()
{T:3} |
]])
end)
it('works correctly with redraw', function()
command('echohl Test')
meths.set_var('opts', {prompt='Foo>', default='Bar'})
feed([[:echo inputdialog(opts)<CR>]])
screen:expect([[
|
{EOB:~ }|
{EOB:~ }|
{EOB:~ }|
{T:Foo>}Bar^ |
]])
command('redraw!')
screen:expect([[
|
{EOB:~ }|
{EOB:~ }|
{EOB:~ }|
{T:Foo>}Bar^ |
]])
feed('<BS>')
screen:expect([[
|
{EOB:~ }|
{EOB:~ }|
{EOB:~ }|
{T:Foo>}Ba^ |
]])
command('redraw!')
screen:expect([[
|
{EOB:~ }|
{EOB:~ }|
{EOB:~ }|
{T:Foo>}Ba^ |
]])
end)
it('allows omitting everything with dictionary argument', function()
command('echohl Test')
feed([[:call input({})<CR>]])
@ -209,8 +246,9 @@ describe('inputdialog()', function()
]])
end)
it('works correctly with multiple numeric arguments (dict arg)', function()
feed([[:echohl Test | echo inputdialog({"prompt": 1, "default": 2, "cancelreturn": 3})<CR>]])
command('redraw!') -- Without this it shows `12` on the line above.
command('echohl Test')
meths.set_var('opts', {prompt=1, default=2, cancelreturn=3})
feed([[:echo input(opts)<CR>]])
screen:expect([[
|
{EOB:~ }|
@ -235,6 +273,42 @@ describe('inputdialog()', function()
{T:3} |
]])
end)
it('works correctly with redraw', function()
command('echohl Test')
meths.set_var('opts', {prompt='Foo>', default='Bar'})
feed([[:echo input(opts)<CR>]])
screen:expect([[
|
{EOB:~ }|
{EOB:~ }|
{EOB:~ }|
{T:Foo>}Bar^ |
]])
command('redraw!')
screen:expect([[
|
{EOB:~ }|
{EOB:~ }|
{EOB:~ }|
{T:Foo>}Bar^ |
]])
feed('<BS>')
screen:expect([[
|
{EOB:~ }|
{EOB:~ }|
{EOB:~ }|
{T:Foo>}Ba^ |
]])
command('redraw!')
screen:expect([[
|
{EOB:~ }|
{EOB:~ }|
{EOB:~ }|
{T:Foo>}Ba^ |
]])
end)
it('allows omitting everything with dictionary argument', function()
command('echohl Test')
feed(':echo inputdialog({})<CR>')