neovim/test/functional/legacy/021_control_wi_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

41 lines
1.0 KiB
Lua

-- Tests for [ CTRL-I with a count and CTRL-W CTRL-I with a count
local helpers = require('test.functional.helpers')(after_each)
local clear, feed, insert = helpers.clear, helpers.feed, helpers.insert
local feed_command, expect = helpers.feed_command, helpers.expect
describe('CTRL-W CTRL-I', function()
setup(clear)
it('is working', function()
insert([[
#include test21.in
/* test text test tex start here
some text
test text
start OK if found this line
start found wrong line
test text]])
-- Search for the second occurence of start and append to register
feed_command('/start')
feed('2[<C-i>')
feed_command('yank A')
-- Same as above but using different keystrokes.
feed('?start<cr>')
feed('2<C-w><Tab>')
feed_command('yank A')
-- Clean buffer and put register
feed('ggdG"ap')
feed_command('1d')
-- The buffer should now contain:
expect([[
start OK if found this line
start OK if found this line]])
end)
end)