functests: Test loading last search/substitute pattern/replacement

This commit is contained in:
ZyX 2015-06-28 07:36:51 +03:00
parent bc52522616
commit 9ab08c8256

View File

@ -102,4 +102,26 @@ describe('ShaDa support code', function()
eq('Test 2', nvim_eval('histget("@", -1)'))
eq('c', nvim_eval('histget(">", -1)'))
end)
it('dumps and loads last search pattern with offset', function()
nvim_eval('setline(".", ["foo", "bar"])')
nvim_feed('gg0/a/e+1\n')
eq({0, 2, 3, 0}, nvim_eval('getpos(".")'))
nvim_command('wviminfo')
reset()
nvim_eval('setline(".", ["foo", "bar"])')
nvim_feed('gg0n')
eq({0, 2, 3, 0}, nvim_eval('getpos(".")'))
end)
it('dumps and loads last substitute pattern and replacement string', function()
nvim_eval('setline(".", ["foo", "bar"])')
nvim_command('%s/f/g/g')
eq('goo', nvim_eval('getline(1)'))
nvim_command('wviminfo')
reset()
nvim_eval('setline(".", ["foo", "bar"])')
nvim_command('&')
eq('goo', nvim_eval('getline(1)'))
end)
end)