tests: introduce screen:expect{...} form

This commit is contained in:
Björn Linse
2018-08-20 18:51:25 +02:00
parent 03978a0f29
commit 3d88287e30
17 changed files with 600 additions and 674 deletions

View File

@@ -207,18 +207,18 @@ describe('terminal buffer', function()
feed_command('terminal')
feed('<c-\\><c-n>')
feed_command('confirm bdelete')
screen:expect('Close "term://', nil, true, nil, true)
screen:expect{any='Close "term://', attr_ignore=true}
end)
it('with &confirm', function()
feed_command('terminal')
feed('<c-\\><c-n>')
feed_command('bdelete')
screen:expect('E89', nil, true, nil, true)
screen:expect{any='E89', attr_ignore=true}
feed('<cr>')
eq('terminal', eval('&buftype'))
feed_command('set confirm | bdelete')
screen:expect('Close "term://', nil, true, nil, true)
screen:expect{any='Close "term://', attr_ignore=true}
feed('y')
neq('terminal', eval('&buftype'))
end)
@@ -242,7 +242,7 @@ describe('No heap-buffer-overflow when using', function()
feed('$')
-- Let termopen() modify the buffer
feed_command('call termopen("echo")')
wait()
eq(2, eval('1+1')) -- check nvim still running
feed_command('bdelete!')
end)
end)