test: avoid extra clear() calls

also: various other cleanup
This commit is contained in:
Justin M. Keyes
2017-10-02 00:24:19 +02:00
parent e9dba214ea
commit 6f7754dfa0
3 changed files with 29 additions and 40 deletions

View File

@@ -120,16 +120,10 @@ describe('Screen', function()
end)
it('has correct default title with named file', function()
local expected = 'myfile (/mydir) - NVIM'
if iswin() then
expected = 'myfile (C:\\mydir) - NVIM'
end
local expected = (iswin() and 'myfile (C:\\mydir) - NVIM'
or 'myfile (/mydir) - NVIM')
command('set title')
if iswin() then
command('file C:\\mydir\\myfile')
else
command('file /mydir/myfile')
end
command(iswin() and 'file C:\\mydir\\myfile' or 'file /mydir/myfile')
screen:expect(function()
eq(expected, screen.title)
end)