mirror of
https://github.com/neovim/neovim.git
synced 2024-12-31 17:13:26 -07:00
oldfiles_spec: Set the shada file in the session
This commit is contained in:
parent
2b191ac5b9
commit
4488bfcfb3
@ -5,12 +5,13 @@ local buf, eq, feed_command = helpers.curbufmeths, helpers.eq, helpers.feed_comm
|
|||||||
local feed, nvim_prog, wait = helpers.feed, helpers.nvim_prog, helpers.wait
|
local feed, nvim_prog, wait = helpers.feed, helpers.nvim_prog, helpers.wait
|
||||||
local ok, set_session, spawn = helpers.ok, helpers.set_session, helpers.spawn
|
local ok, set_session, spawn = helpers.ok, helpers.set_session, helpers.spawn
|
||||||
|
|
||||||
local shada_file = 'test.shada'
|
local shada_file = 'Xtest.shada'
|
||||||
|
|
||||||
local function _clear()
|
local function _clear()
|
||||||
set_session(spawn({nvim_prog, '--embed', '-u', 'NONE', '--cmd',
|
set_session(spawn({nvim_prog, '--embed', '-u', 'NONE',
|
||||||
-- Need shada for these tests.
|
-- Need shada for these tests.
|
||||||
'set noswapfile undodir=. directory=. viewdir=. backupdir=. belloff= noshowcmd noruler'}))
|
'-i', shada_file,
|
||||||
|
'--cmd', 'set noswapfile undodir=. directory=. viewdir=. backupdir=. belloff= noshowcmd noruler'}))
|
||||||
end
|
end
|
||||||
|
|
||||||
describe(':oldfiles', function()
|
describe(':oldfiles', function()
|
||||||
@ -29,8 +30,8 @@ describe(':oldfiles', function()
|
|||||||
screen:attach()
|
screen:attach()
|
||||||
feed_command('edit testfile1')
|
feed_command('edit testfile1')
|
||||||
feed_command('edit testfile2')
|
feed_command('edit testfile2')
|
||||||
feed_command('wshada ' .. shada_file)
|
feed_command('wshada')
|
||||||
feed_command('rshada! ' .. shada_file)
|
feed_command('rshada!')
|
||||||
local oldfiles = helpers.meths.get_vvar('oldfiles')
|
local oldfiles = helpers.meths.get_vvar('oldfiles')
|
||||||
feed_command('oldfiles')
|
feed_command('oldfiles')
|
||||||
screen:expect([[
|
screen:expect([[
|
||||||
@ -54,10 +55,9 @@ describe(':browse oldfiles', function()
|
|||||||
filename = buf.get_name()
|
filename = buf.get_name()
|
||||||
feed_command('edit testfile2')
|
feed_command('edit testfile2')
|
||||||
filename2 = buf.get_name()
|
filename2 = buf.get_name()
|
||||||
feed_command('wshada ' .. shada_file)
|
feed_command('wshada')
|
||||||
wait()
|
wait()
|
||||||
_clear()
|
_clear()
|
||||||
feed_command('rshada! ' .. shada_file)
|
|
||||||
|
|
||||||
-- Ensure nvim is out of "Press ENTER..." prompt.
|
-- Ensure nvim is out of "Press ENTER..." prompt.
|
||||||
feed('<cr>')
|
feed('<cr>')
|
||||||
|
Loading…
Reference in New Issue
Block a user