aboutsummaryrefslogtreecommitdiff
path: root/test/functional/shada/buffers_spec.lua
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-06-08 23:22:50 +0200
committerbfredl <bjorn.linse@gmail.com>2022-06-13 10:15:44 +0200
commite3281d992e1b9366d67a4b4399e3b5e11bb6c1cc (patch)
treefe0a8377115e946faf1c0328285331b4fd6c8a4c /test/functional/shada/buffers_spec.lua
parentdd8b6094c03362cc60d627ce709a4a0f9825b86a (diff)
downloadrneovim-e3281d992e1b9366d67a4b4399e3b5e11bb6c1cc.tar.gz
rneovim-e3281d992e1b9366d67a4b4399e3b5e11bb6c1cc.tar.bz2
rneovim-e3281d992e1b9366d67a4b4399e3b5e11bb6c1cc.zip
fix(tests): check for EOF on exit of nvim properly
Diffstat (limited to 'test/functional/shada/buffers_spec.lua')
-rw-r--r--test/functional/shada/buffers_spec.lua15
1 files changed, 8 insertions, 7 deletions
diff --git a/test/functional/shada/buffers_spec.lua b/test/functional/shada/buffers_spec.lua
index 04c9c01d7c..26a4569fce 100644
--- a/test/functional/shada/buffers_spec.lua
+++ b/test/functional/shada/buffers_spec.lua
@@ -2,6 +2,7 @@
local helpers = require('test.functional.helpers')(after_each)
local nvim_command, funcs, eq, curbufmeths =
helpers.command, helpers.funcs, helpers.eq, helpers.curbufmeths
+local expect_exit = helpers.expect_exit
local shada_helpers = require('test.functional.shada.helpers')
local reset, clear = shada_helpers.reset, shada_helpers.clear
@@ -15,7 +16,7 @@ describe('shada support code', function()
reset('set shada+=%')
nvim_command('edit ' .. testfilename)
nvim_command('edit ' .. testfilename_2)
- nvim_command('qall')
+ expect_exit(nvim_command, 'qall')
reset('set shada+=%')
eq(3, funcs.bufnr('$'))
eq('', funcs.bufname(1))
@@ -27,7 +28,7 @@ describe('shada support code', function()
reset('set shada+=%')
nvim_command('edit ' .. testfilename)
nvim_command('edit ' .. testfilename_2)
- nvim_command('qall')
+ expect_exit(nvim_command, 'qall')
reset()
eq(1, funcs.bufnr('$'))
eq('', funcs.bufname(1))
@@ -37,7 +38,7 @@ describe('shada support code', function()
reset()
nvim_command('edit ' .. testfilename)
nvim_command('edit ' .. testfilename_2)
- nvim_command('qall')
+ expect_exit(nvim_command, 'qall')
reset('set shada+=%')
eq(1, funcs.bufnr('$'))
eq('', funcs.bufname(1))
@@ -48,7 +49,7 @@ describe('shada support code', function()
nvim_command('edit ' .. testfilename)
nvim_command('edit ' .. testfilename_2)
curbufmeths.set_option('buflisted', false)
- nvim_command('qall')
+ expect_exit(nvim_command, 'qall')
reset('set shada+=%')
eq(2, funcs.bufnr('$'))
eq('', funcs.bufname(1))
@@ -60,7 +61,7 @@ describe('shada support code', function()
nvim_command('edit ' .. testfilename)
nvim_command('edit ' .. testfilename_2)
curbufmeths.set_option('buftype', 'quickfix')
- nvim_command('qall')
+ expect_exit(nvim_command, 'qall')
reset('set shada+=%')
eq(2, funcs.bufnr('$'))
eq('', funcs.bufname(1))
@@ -73,7 +74,7 @@ describe('shada support code', function()
nvim_command('enew')
curbufmeths.set_lines(0, 1, true, {'bar'})
eq(2, funcs.bufnr('$'))
- nvim_command('qall!')
+ expect_exit(nvim_command, 'qall!')
reset('set shada+=% hidden')
eq(1, funcs.bufnr('$'))
eq('', funcs.bufname(1))
@@ -83,7 +84,7 @@ describe('shada support code', function()
reset('set shada+=%1')
nvim_command('edit ' .. testfilename)
nvim_command('edit ' .. testfilename_2)
- nvim_command('qall')
+ expect_exit(nvim_command, 'qall')
reset('set shada+=%1')
eq(2, funcs.bufnr('$'))
eq('', funcs.bufname(1))