test: Add extra screen expectation to prevent race condition

This is to ensure ctrl+c is only pressed after the command has started executing
in the viml_system_spec.lua system() interrupt test.
This commit is contained in:
Thiago de Arruda 2015-02-20 20:41:03 -03:00
parent a21d952bdd
commit f9d327c88b

View File

@ -79,6 +79,22 @@ describe('system()', function()
it('`yes` and is interrupted with CTRL-C', function()
feed(':call system("yes")<cr>')
screen:expect([[
|
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
^call system("yes") |
]])
feed('<c-c>')
screen:expect([[
^ |
@ -227,8 +243,24 @@ describe('systemlist()', function()
]])
end)
it('`yes` and is a little bit later interrupted with CTRL-C', function()
it('`yes` and is interrupted with CTRL-C', function()
feed(':call systemlist("yes | xargs")<cr>')
screen:expect([[
|
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
~ |
^call systemlist("yes | xargs") |
]])
feed('<c-c>')
screen:expect([[
^ |