summaryrefslogtreecommitdiffstatshomepage
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.lua23
1 files changed, 23 insertions, 0 deletions
diff --git a/test/functional/shada/buffers_spec.lua b/test/functional/shada/buffers_spec.lua
index 259dddea67..2c1425058c 100644
--- a/test/functional/shada/buffers_spec.lua
+++ b/test/functional/shada/buffers_spec.lua
@@ -104,4 +104,27 @@ describe('shada support code', function()
eq(1, #oldfiles)
t.matches(vim.pesc(testfilename_2), oldfiles[1])
end)
+
+ it("saves bdelete'd buffer to v:oldfiles #39010", function()
+ reset("set shada='100")
+ nvim_command('edit ' .. testfilename)
+ nvim_command('bdelete')
+ nvim_command('edit ' .. testfilename_2)
+ expect_exit(nvim_command, 'qall')
+ reset("set shada='100")
+ local oldfiles = api.nvim_get_vvar('oldfiles')
+ eq(2, #oldfiles)
+ end)
+
+ it("does not dump bdelete'd buffer to buffer list", function()
+ reset('set shada+=%')
+ nvim_command('edit ' .. testfilename)
+ nvim_command('edit ' .. testfilename_2)
+ nvim_command('bdelete ' .. testfilename)
+ expect_exit(nvim_command, 'qall')
+ reset('set shada+=%')
+ eq(2, fn.bufnr('$'))
+ eq('', fn.bufname(1))
+ eq(testfilename_2, fn.bufname(2))
+ end)
end)