functests: Replace execute with either command or feed_command

Hope this will make people using feed_command less likely: this hides bugs.
Already found at least two:

1. msgpackparse() will show internal error: hash_add() in case of duplicate
   keys, though it will still work correctly. Currently silenced.
2. ttimeoutlen was spelled incorrectly, resulting in option not being set when
   expected. Test was still functioning somehow though. Currently fixed.
This commit is contained in:
ZyX
2017-04-09 00:12:26 +03:00
parent 9158cc171f
commit 65fb622000
155 changed files with 3174 additions and 3075 deletions

View File

@@ -1,7 +1,7 @@
local helpers = require('test.functional.helpers')(after_each)
local Screen = require('test.functional.ui.screen')
local clear, feed, meths = helpers.clear, helpers.feed, helpers.meths
local insert, execute = helpers.insert, helpers.execute
local insert, command = helpers.insert, helpers.command
describe('quickfix selection highlight', function()
@@ -28,8 +28,8 @@ describe('quickfix selection highlight', function()
})
meths.set_option('errorformat', '%m %l')
execute('syntax on')
execute('highlight Search guibg=Green')
command('syntax on')
command('highlight Search guibg=Green')
insert([[
Line 1
@@ -39,7 +39,7 @@ describe('quickfix selection highlight', function()
Line 5
]])
execute('cad')
command('cad')
feed('gg')
screen:expect([[
@@ -57,7 +57,7 @@ describe('quickfix selection highlight', function()
end)
it('using default Search highlight group', function()
execute('copen')
command('copen')
screen:expect([[
Line 1 |
@@ -72,7 +72,7 @@ describe('quickfix selection highlight', function()
:copen |
]])
execute('cnext')
command('cnext')
screen:expect([[
Line 1 |
@@ -89,9 +89,9 @@ describe('quickfix selection highlight', function()
end)
it('using QuickFixLine highlight group', function()
execute('highlight QuickFixLine guibg=Red')
command('highlight QuickFixLine guibg=Red')
execute('copen')
command('copen')
screen:expect([[
Line 1 |
@@ -106,7 +106,7 @@ describe('quickfix selection highlight', function()
:copen |
]])
execute('cnext')
command('cnext')
screen:expect([[
Line 1 |
@@ -123,11 +123,11 @@ describe('quickfix selection highlight', function()
end)
it('combines with CursorLine', function()
execute('set cursorline')
execute('highlight QuickFixLine guifg=Red')
execute('highlight CursorLine guibg=Fuchsia')
command('set cursorline')
command('highlight QuickFixLine guifg=Red')
command('highlight CursorLine guibg=Fuchsia')
execute('copen')
command('copen')
screen:expect([[
{9:Line 1 }|
@@ -159,11 +159,11 @@ describe('quickfix selection highlight', function()
end)
it('QuickFixLine background takes precedence over CursorLine', function()
execute('set cursorline')
execute('highlight QuickFixLine guibg=Red')
execute('highlight CursorLine guibg=Fuchsia')
command('set cursorline')
command('highlight QuickFixLine guibg=Red')
command('highlight CursorLine guibg=Fuchsia')
execute('copen')
command('copen')
screen:expect([[
{9:Line 1 }|