neovim/test/functional/plugin/matchparen_spec.lua
ZyX 65fb622000 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.
2017-04-09 03:24:08 +03:00

47 lines
1.2 KiB
Lua

local helpers = require('test.functional.helpers')(after_each)
local plugin_helpers = require('test.functional.plugin.helpers')
local Screen = require('test.functional.ui.screen')
local command = helpers.command
local meths = helpers.meths
local feed = helpers.feed
local eq = helpers.eq
local reset = plugin_helpers.reset
describe('matchparen', function()
local screen
before_each(function()
reset()
screen = Screen.new(20,5)
screen:attach()
screen:set_default_attr_ids( {
[0] = {bold=true, foreground=255},
[1] = {bold=true},
} )
end)
it('uses correct column after i_<Up>. Vim patch 7.4.1296', function()
command('set noautoindent nosmartindent nocindent laststatus=0')
eq(1, meths.get_var('loaded_matchparen'))
feed('ivoid f_test()<cr>')
feed('{<cr>')
feed('}')
-- critical part: up + cr should result in an empty line inbetween the
-- brackets... if the bug is there, the empty line will be before the '{'
feed('<up>')
feed('<cr>')
screen:expect([[
void f_test() |
{ |
^ |
} |
{1:-- INSERT --} |
]])
end)
end)