aboutsummaryrefslogtreecommitdiff
path: root/test/functional/shada/buffers_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/shada/buffers_spec.lua')
-rw-r--r--test/functional/shada/buffers_spec.lua18
1 files changed, 15 insertions, 3 deletions
diff --git a/test/functional/shada/buffers_spec.lua b/test/functional/shada/buffers_spec.lua
index fd4809e01a..a4746c2205 100644
--- a/test/functional/shada/buffers_spec.lua
+++ b/test/functional/shada/buffers_spec.lua
@@ -1,5 +1,5 @@
-- ShaDa buffer list saving/reading support
-local helpers = require('test.functional.helpers')
+local helpers = require('test.functional.helpers')(after_each)
local nvim_command, funcs, eq, curbufmeths =
helpers.command, helpers.funcs, helpers.eq, helpers.curbufmeths
@@ -78,13 +78,25 @@ describe('ShaDa support code', function()
it('does not dump unnamed buffers', function()
set_additional_cmd('set shada+=% hidden')
reset()
- curbufmeths.set_line(0, 'foo')
+ curbufmeths.set_lines(0, 1, true, {'foo'})
nvim_command('enew')
- curbufmeths.set_line(0, 'bar')
+ curbufmeths.set_lines(0, 1, true, {'bar'})
eq(2, funcs.bufnr('$'))
nvim_command('qall!')
reset()
eq(1, funcs.bufnr('$'))
eq('', funcs.bufname(1))
end)
+
+ it('restores 1 buffer with %1 in &shada, #5759', function()
+ set_additional_cmd('set shada+=%1')
+ reset()
+ nvim_command('edit ' .. testfilename)
+ nvim_command('edit ' .. testfilename_2)
+ nvim_command('qall')
+ reset()
+ eq(2, funcs.bufnr('$'))
+ eq('', funcs.bufname(1))
+ eq(testfilename, funcs.bufname(2))
+ end)
end)