mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
052498ed42
Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
42 lines
975 B
Lua
42 lines
975 B
Lua
-- Test for sourcing a file with CTRL-V's at the end of the line
|
||
|
||
local n = require('test.functional.testnvim')()
|
||
|
||
local clear, feed, insert = n.clear, n.feed, n.insert
|
||
local feed_command, expect = n.feed_command, n.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)
|