neovim/test/functional/legacy/028_source_ctrl_v_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
1019 B
Lua
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

-- Test for sourcing a file with CTRL-V's at the end of the line
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-V at the end of the line', function()
setup(clear)
it('is working', function()
insert([[
firstline
map __1 afirst
map __2 asecond
map __3 athird
map __4 afourth
map __5 afifth
map __1 asdX
map __2 asdXX
map __3 asdXX
map __4 asdXXX
map __5 asdXXX
lastline]])
feed(':%s/X/<C-v><C-v>/g<cr>')
feed(':/firstline/+1,/lastline/-1w! Xtestfile<cr>')
feed_command('so Xtestfile')
feed_command('%d')
feed('Gmm__1<Esc><Esc>__2<Esc>__3<Esc><Esc>__4<Esc>__5<Esc>')
feed(":'m,$s/<C-v><C-@>/0/g<cr>")
expect([[
sd
map __2 asdsecondsdsd0map __5 asd0fifth]])
end)
teardown(function()
os.remove('Xtestfile')
end)
end)