shada: Populate v:oldfiles

This commit is contained in:
ZyX
2015-07-07 23:49:22 +03:00
parent f43a5e6926
commit 1d3823a5c9
2 changed files with 101 additions and 21 deletions

View File

@@ -95,6 +95,21 @@ describe('ShaDa support code', function()
eq(2, nvim_current_line())
end)
it('is able to populate v:oldfiles', function()
nvim_command('edit ' .. testfilename)
local tf_full = nvim_eval('fnamemodify(bufname("%"), ":p")')
nvim_command('edit ' .. testfilename_2)
local tf_full_2 = nvim_eval('fnamemodify(bufname("%"), ":p")')
nvim_command('qall')
reset()
local oldfiles = nvim('get_vvar', 'oldfiles')
eq(2, #oldfiles)
eq(testfilename, oldfiles[1]:sub(-#testfilename))
eq(testfilename_2, oldfiles[2]:sub(-#testfilename_2))
eq(tf_full, oldfiles[1])
eq(tf_full_2, oldfiles[2])
end)
it('is able to dump and restore jump list', function()
nvim_command('edit ' .. testfilename_2)
nvim_feed('G')