From e3281d992e1b9366d67a4b4399e3b5e11bb6c1cc Mon Sep 17 00:00:00 2001 From: bfredl Date: Wed, 8 Jun 2022 23:22:50 +0200 Subject: [PATCH] fix(tests): check for EOF on exit of nvim properly --- test/functional/api/vim_spec.lua | 3 +- test/functional/core/fileio_spec.lua | 3 +- test/functional/ex_cmds/mksession_spec.lua | 7 +++-- test/functional/helpers.lua | 7 +++++ .../legacy/008_autocommands_spec.lua | 3 +- test/functional/legacy/012_directory_spec.lua | 3 +- .../legacy/031_close_commands_spec.lua | 3 +- test/functional/lua/vim_spec.lua | 6 ++-- test/functional/options/defaults_spec.lua | 3 +- test/functional/shada/buffers_spec.lua | 15 +++++----- test/functional/shada/history_spec.lua | 21 +++++++------- test/functional/shada/marks_spec.lua | 15 +++++----- test/functional/shada/registers_spec.lua | 29 ++++++++++--------- test/functional/shada/variables_spec.lua | 7 +++-- test/functional/ui/syntax_conceal_spec.lua | 3 +- third-party/cmake/BuildLuarocks.cmake | 2 +- 16 files changed, 74 insertions(+), 56 deletions(-) diff --git a/test/functional/api/vim_spec.lua b/test/functional/api/vim_spec.lua index 55535a92e5..ea5725d836 100644 --- a/test/functional/api/vim_spec.lua +++ b/test/functional/api/vim_spec.lua @@ -27,6 +27,7 @@ local write_file = helpers.write_file local exec_lua = helpers.exec_lua local exc_exec = helpers.exc_exec local insert = helpers.insert +local expect_exit = helpers.expect_exit local pcall_err = helpers.pcall_err local format_string = helpers.format_string @@ -2617,7 +2618,7 @@ describe('API', function() it('does not cause heap-use-after-free on exit while setting options', function() command('au OptionSet * q') - command('silent! call nvim_create_buf(0, 1)') + expect_exit(command, 'silent! call nvim_create_buf(0, 1)') end) end) diff --git a/test/functional/core/fileio_spec.lua b/test/functional/core/fileio_spec.lua index c68bc18eed..bc025771d1 100644 --- a/test/functional/core/fileio_spec.lua +++ b/test/functional/core/fileio_spec.lua @@ -16,12 +16,13 @@ local trim = helpers.trim local currentdir = helpers.funcs.getcwd local iswin = helpers.iswin local assert_alive = helpers.assert_alive +local expect_exit = helpers.expect_exit describe('fileio', function() before_each(function() end) after_each(function() - command(':qall!') + expect_exit(command, ':qall!') os.remove('Xtest_startup_shada') os.remove('Xtest_startup_file1') os.remove('Xtest_startup_file1~') diff --git a/test/functional/ex_cmds/mksession_spec.lua b/test/functional/ex_cmds/mksession_spec.lua index 8323d40e10..1553de4432 100644 --- a/test/functional/ex_cmds/mksession_spec.lua +++ b/test/functional/ex_cmds/mksession_spec.lua @@ -14,6 +14,7 @@ local pesc = helpers.pesc local rmdir = helpers.rmdir local sleep = helpers.sleep local meths = helpers.meths +local expect_exit = helpers.expect_exit local file_prefix = 'Xtest-functional-ex_cmds-mksession_spec' @@ -44,7 +45,7 @@ describe(':mksession', function() command('mksession '..session_file) -- Create a new test instance of Nvim. - command('qall!') + expect_exit(command, 'qall!') clear() -- Restore session. command('source '..session_file) @@ -113,7 +114,7 @@ describe(':mksession', function() if iswin() then sleep(100) -- Make sure all child processes have exited. end - command('qall!') + expect_exit(command, 'qall!') -- Create a new test instance of Nvim. clear() @@ -156,7 +157,7 @@ describe(':mksession', function() command('cd '..cwd_dir) command('mksession '..session_path) - command('qall!') + expect_exit(command, 'qall!') -- Create a new test instance of Nvim. clear() diff --git a/test/functional/helpers.lua b/test/functional/helpers.lua index 7c923351ab..ffb5694c15 100644 --- a/test/functional/helpers.lua +++ b/test/functional/helpers.lua @@ -270,6 +270,13 @@ function module.command(cmd) module.request('nvim_command', cmd) end + +-- use for commands which expect nvim to quit +function module.expect_exit(...) + eq("EOF was received from Nvim. Likely the Nvim process crashed.", + module.pcall_err(...)) +end + -- Evaluates a VimL expression. -- Fails on VimL error, but does not update v:errmsg. function module.eval(expr) diff --git a/test/functional/legacy/008_autocommands_spec.lua b/test/functional/legacy/008_autocommands_spec.lua index 002f037d09..4088cd1644 100644 --- a/test/functional/legacy/008_autocommands_spec.lua +++ b/test/functional/legacy/008_autocommands_spec.lua @@ -6,6 +6,7 @@ local source = helpers.source local clear, command, expect, eq, eval = helpers.clear, helpers.command, helpers.expect, helpers.eq, helpers.eval local write_file, dedent = helpers.write_file, helpers.dedent local read_file = helpers.read_file +local expect_exit = helpers.expect_exit describe('autocommands that delete and unload buffers:', function() local test_file = 'Xtest-008_autocommands.out' @@ -78,7 +79,7 @@ describe('autocommands that delete and unload buffers:', function() command('silent! edit Xxx1') command('silent! edit Makefile') -- an existing file command('silent! split new2') - command('silent! quit') + expect_exit(command, 'silent! quit') eq('VimLeave done', string.match(read_file(test_file), "^%s*(.-)%s*$")) end) diff --git a/test/functional/legacy/012_directory_spec.lua b/test/functional/legacy/012_directory_spec.lua index f666e51469..dd207ca0b4 100644 --- a/test/functional/legacy/012_directory_spec.lua +++ b/test/functional/legacy/012_directory_spec.lua @@ -16,6 +16,7 @@ local insert = helpers.insert local command = helpers.command local write_file = helpers.write_file local curbufmeths = helpers.curbufmeths +local expect_exit = helpers.expect_exit local function ls_dir_sorted(dirname) local files = {} @@ -43,7 +44,7 @@ describe("'directory' option", function() clear() end) teardown(function() - command('qall!') + expect_exit(command, 'qall!') helpers.rmdir('Xtest.je') helpers.rmdir('Xtest2') os.remove('Xtest1') diff --git a/test/functional/legacy/031_close_commands_spec.lua b/test/functional/legacy/031_close_commands_spec.lua index 64c67c9882..d02b1a2049 100644 --- a/test/functional/legacy/031_close_commands_spec.lua +++ b/test/functional/legacy/031_close_commands_spec.lua @@ -17,6 +17,7 @@ local source = helpers.source local insert = helpers.insert local expect = helpers.expect local feed_command = helpers.feed_command +local expect_exit = helpers.expect_exit describe('Commands that close windows and/or buffers', function() local function cleanup() @@ -118,7 +119,7 @@ describe('Commands that close windows and/or buffers', function() feed_command('q!') feed('') expect('testtext 1') - source([[ + expect_exit(source, [[ q! " Now nvim should have exited throw "Oh, Not finished yet."]]) diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua index fd05e6ec0b..861f85674f 100644 --- a/test/functional/lua/vim_spec.lua +++ b/test/functional/lua/vim_spec.lua @@ -22,7 +22,7 @@ local remove_trace = helpers.remove_trace local mkdir_p = helpers.mkdir_p local rmdir = helpers.rmdir local write_file = helpers.write_file - +local expect_exit = helpers.expect_exit describe('lua stdlib', function() before_each(clear) @@ -2677,9 +2677,7 @@ describe('lua: builtin modules', function() it('does not work when disabled without runtime', function() clear{args={'--luamod-dev'}, env={VIMRUNTIME='fixtures/a'}} - -- error checking could be better here. just check that --luamod-dev - -- does anything at all by breaking with missing runtime.. - eq(nil, exec_lua[[return vim.tbl_count {x=1,y=2}]]) + expect_exit(exec_lua, [[return vim.tbl_count {x=1,y=2}]]) end) end) diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua index 4731df7b95..92873e9937 100644 --- a/test/functional/options/defaults_spec.lua +++ b/test/functional/options/defaults_spec.lua @@ -17,6 +17,7 @@ local mkdir = helpers.mkdir local rmdir = helpers.rmdir local alter_slashes = helpers.alter_slashes local tbl_contains = helpers.tbl_contains +local expect_exit = helpers.expect_exit describe('startup defaults', function() describe(':filetype', function() @@ -174,7 +175,7 @@ describe('startup defaults', function() command('write') local f = eval('fnamemodify(@%,":p")') assert(string.len(f) > 3) - command('qall') + expect_exit(command, 'qall') clear{args={}, args_rm={'-i'}, env=env} eq({ f }, eval('v:oldfiles')) os.remove('Xtest-foo') 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)) diff --git a/test/functional/shada/history_spec.lua b/test/functional/shada/history_spec.lua index 84cc34c7cc..d1daf6c7cc 100644 --- a/test/functional/shada/history_spec.lua +++ b/test/functional/shada/history_spec.lua @@ -3,6 +3,7 @@ local helpers = require('test.functional.helpers')(after_each) local nvim_command, funcs, meths, nvim_feed, eq = helpers.command, helpers.funcs, helpers.meths, helpers.feed, helpers.eq local assert_alive = helpers.assert_alive +local expect_exit = helpers.expect_exit local shada_helpers = require('test.functional.shada.helpers') local reset, clear = shada_helpers.reset, shada_helpers.clear @@ -25,13 +26,13 @@ describe('ShaDa support code', function() nvim_command('set shada=\'0 history=2') nvim_feed(':" Test\n') nvim_feed(':" Test 2\n') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() nvim_command('set shada=\'0 history=2') nvim_command('rshada') eq('" Test 2', funcs.histget(':', -1)) eq('" Test', funcs.histget(':', -2)) - nvim_command('qall') + expect_exit(nvim_command, 'qall') end) it('respects &history when dumping', @@ -138,7 +139,7 @@ describe('ShaDa support code', function() nvim_command('set hlsearch shada-=h') nvim_feed('/test\n') eq(1, meths.get_vvar('hlsearch')) - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq(1, meths.get_vvar('hlsearch')) end) @@ -147,7 +148,7 @@ describe('ShaDa support code', function() nvim_command('set hlsearch shada-=h') nvim_feed('/test\n') nvim_command('nohlsearch') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq(0, meths.get_vvar('hlsearch')) end) @@ -156,7 +157,7 @@ describe('ShaDa support code', function() nvim_command('set hlsearch') nvim_feed('/test\n') eq(1, meths.get_vvar('hlsearch')) - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq(0, meths.get_vvar('hlsearch')) end) @@ -175,7 +176,7 @@ describe('ShaDa support code', function() it('dumps and loads history with UTF-8 characters', function() reset() nvim_feed(':echo "«"\n') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq('echo "«"', funcs.histget(':', -1)) end) @@ -183,7 +184,7 @@ describe('ShaDa support code', function() it('dumps and loads replacement with UTF-8 characters', function() nvim_command('substitute/./«/ge') - nvim_command('qall!') + expect_exit(nvim_command, 'qall!') reset() funcs.setline('.', {'.'}) nvim_command('&') @@ -193,7 +194,7 @@ describe('ShaDa support code', function() it('dumps and loads substitute pattern with UTF-8 characters', function() nvim_command('substitute/«/./ge') - nvim_command('qall!') + expect_exit(nvim_command, 'qall!') reset() funcs.setline('.', {'«\171'}) nvim_command('&') @@ -204,7 +205,7 @@ describe('ShaDa support code', function() function() nvim_command('silent! /«/') nvim_command('set shada+=/0') - nvim_command('qall!') + expect_exit(nvim_command, 'qall!') reset() funcs.setline('.', {'\171«'}) nvim_command('~&') @@ -217,7 +218,7 @@ describe('ShaDa support code', function() -- \171 is U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK in latin1 nvim_command('silent! /\171/') nvim_command('set shada+=/0') - nvim_command('qall!') + expect_exit(nvim_command, 'qall!') reset() funcs.setline('.', {'\171«'}) nvim_command('~&') diff --git a/test/functional/shada/marks_spec.lua b/test/functional/shada/marks_spec.lua index 153a1c346f..a91be18841 100644 --- a/test/functional/shada/marks_spec.lua +++ b/test/functional/shada/marks_spec.lua @@ -4,6 +4,7 @@ local meths, curwinmeths, curbufmeths, nvim_command, funcs, eq = helpers.meths, helpers.curwinmeths, helpers.curbufmeths, helpers.command, helpers.funcs, helpers.eq local exc_exec, exec_capture = helpers.exc_exec, helpers.exec_capture +local expect_exit = helpers.expect_exit local shada_helpers = require('test.functional.shada.helpers') local reset, clear = shada_helpers.reset, shada_helpers.clear @@ -79,7 +80,7 @@ describe('ShaDa support code', function() nvim_command('mark a') nvim_command('2') nvim_command('kb') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() nvim_command('edit ' .. testfilename) nvim_command('normal! `a') @@ -92,7 +93,7 @@ describe('ShaDa support code', function() it('is able to dump and read back mark "', function() nvim_command('edit ' .. testfilename) nvim_command('2') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() nvim_command('edit ' .. testfilename) nvim_command('normal! `"') @@ -104,7 +105,7 @@ describe('ShaDa support code', function() nvim_command('tabedit ' .. testfilename_2) nvim_command('2') nvim_command('q!') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() nvim_command('edit ' .. testfilename_2) nvim_command('normal! `"') @@ -116,7 +117,7 @@ describe('ShaDa support code', function() local tf_full = curbufmeths.get_name() nvim_command('edit ' .. testfilename_2) local tf_full_2 = curbufmeths.get_name() - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() local oldfiles = meths.get_vvar('oldfiles') table.sort(oldfiles) @@ -145,7 +146,7 @@ describe('ShaDa support code', function() nvim_command('enew') nvim_command('normal! gg') local saved = exec_capture('jumps') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq(saved, exec_capture('jumps')) end) @@ -176,7 +177,7 @@ describe('ShaDa support code', function() nvim_command('normal! G') nvim_command('sleep 2') nvim_command('normal! gg') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() nvim_command('redraw') nvim_command('edit ' .. testfilename) @@ -200,7 +201,7 @@ describe('ShaDa support code', function() nvim_command('edit ' .. testfilename) nvim_command('normal! Gra') nvim_command('normal! ggrb') - nvim_command('qall!') + expect_exit(nvim_command, 'qall!') reset() nvim_command('edit ' .. testfilename) nvim_command('normal! Gg;') diff --git a/test/functional/shada/registers_spec.lua b/test/functional/shada/registers_spec.lua index 1f06cbe350..6aaa54cce8 100644 --- a/test/functional/shada/registers_spec.lua +++ b/test/functional/shada/registers_spec.lua @@ -4,6 +4,7 @@ local nvim_command, funcs, eq = helpers.command, helpers.funcs, helpers.eq local shada_helpers = require('test.functional.shada.helpers') local reset, clear = shada_helpers.reset, shada_helpers.clear +local expect_exit = helpers.expect_exit local setreg = function(name, contents, typ) if type(contents) == 'string' then @@ -27,7 +28,7 @@ describe('ShaDa support code', function() setreg('c', {'d', 'e', ''}, 'c') setreg('l', {'a', 'b', 'cde'}, 'l') setreg('b', {'bca', 'abc', 'cba'}, 'b3') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq({{'d', 'e', ''}, 'v'}, getreg('c')) eq({{'a', 'b', 'cde'}, 'V'}, getreg('l')) @@ -39,7 +40,7 @@ describe('ShaDa support code', function() setreg('c', {'d', 'e', ''}, 'c') setreg('l', {'a', 'b', 'cde'}, 'l') setreg('b', {'bca', 'abc', 'cba'}, 'b3') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq({{}, ''}, getreg('c')) eq({{}, ''}, getreg('l')) @@ -50,7 +51,7 @@ describe('ShaDa support code', function() setreg('c', {'d', 'e', ''}, 'c') setreg('l', {'a', 'b', 'cde'}, 'l') setreg('b', {'bca', 'abc', 'cba'}, 'b3') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset('set shada=\'0,<0') eq({{'d', 'e', ''}, 'v'}, getreg('c')) eq({{'a', 'b', 'cde'}, 'V'}, getreg('l')) @@ -62,7 +63,7 @@ describe('ShaDa support code', function() setreg('c', {'d', 'e', ''}, 'c') setreg('l', {'a', 'b', 'cde'}, 'l') setreg('b', {'bca', 'abc', 'cba'}, 'b3') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq({{}, ''}, getreg('c')) eq({{}, ''}, getreg('l')) @@ -73,7 +74,7 @@ describe('ShaDa support code', function() setreg('c', {'d', 'e', ''}, 'c') setreg('l', {'a', 'b', 'cde'}, 'l') setreg('b', {'bca', 'abc', 'cba'}, 'b3') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset('set shada=\'0,\\"0') eq({{'d', 'e', ''}, 'v'}, getreg('c')) eq({{'a', 'b', 'cde'}, 'V'}, getreg('l')) @@ -85,7 +86,7 @@ describe('ShaDa support code', function() setreg('c', {'d', 'e', ''}, 'c') setreg('l', {'a', 'b', 'cde'}, 'l') setreg('b', {'bca', 'abc', 'cba'}, 'b3') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq({{'d', 'e', ''}, 'v'}, getreg('c')) eq({{'a', 'b', 'cde'}, 'V'}, getreg('l')) @@ -96,7 +97,7 @@ describe('ShaDa support code', function() nvim_command('set shada=\'0,<2') setreg('o', {'d'}, 'c') setreg('t', {'a', 'b', 'cde'}, 'l') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq({{'d'}, 'v'}, getreg('o')) eq({{}, ''}, getreg('t')) @@ -106,7 +107,7 @@ describe('ShaDa support code', function() nvim_command('set shada=\'0,\\"2') setreg('o', {'d'}, 'c') setreg('t', {'a', 'b', 'cde'}, 'l') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq({{'d'}, 'v'}, getreg('o')) eq({{}, ''}, getreg('t')) @@ -117,7 +118,7 @@ describe('ShaDa support code', function() setreg('o', {'d'}, 'c') setreg('t', {'a', 'b', 'cde'}, 'l') setreg('h', {'abc', 'acb', 'bac', 'bca', 'cab', 'cba'}, 'b3') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq({{'d'}, 'v'}, getreg('o')) eq({{'a', 'b', 'cde'}, 'V'}, getreg('t')) @@ -128,7 +129,7 @@ describe('ShaDa support code', function() function() reset() setreg('e', {'«'}, 'c') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq({{'«'}, 'v'}, getreg('e')) end) @@ -138,7 +139,7 @@ describe('ShaDa support code', function() reset() -- \171 is U+00AB LEFT-POINTING DOUBLE ANGLE QUOTATION MARK in latin1 setreg('e', {'\171«'}, 'c') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq({{'\171«'}, 'v'}, getreg('e')) end) @@ -148,7 +149,7 @@ describe('ShaDa support code', function() setreg('1', {'one'}, 'c') setreg('2', {'two'}, 'c') setreg('a', {'a'}, 'c') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq({{}, ''}, getreg('0')) eq({{'one'}, 'v'}, getreg('1')) @@ -161,7 +162,7 @@ describe('ShaDa support code', function() setreg('0', {'zero'}, 'c') setreg('1', {'one'}, 'c') setreg('2', {'two'}, 'c') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq({{'zero'}, 'v'}, getreg('0')) eq({{'one'}, 'v'}, getreg('1')) @@ -173,7 +174,7 @@ describe('ShaDa support code', function() setreg('0', {'zero'}, 'c') setreg('1', {'one'}, 'cu') setreg('2', {'two'}, 'c') - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq({{'zero'}, 'v'}, getreg('0')) eq({{'one'}, 'v'}, getreg('1')) diff --git a/test/functional/shada/variables_spec.lua b/test/functional/shada/variables_spec.lua index 854add1363..a91b7eb193 100644 --- a/test/functional/shada/variables_spec.lua +++ b/test/functional/shada/variables_spec.lua @@ -2,6 +2,7 @@ local helpers = require('test.functional.helpers')(after_each) local meths, funcs, nvim_command, eq, eval = helpers.meths, helpers.funcs, helpers.command, helpers.eq, helpers.eval +local expect_exit = helpers.expect_exit local shada_helpers = require('test.functional.shada.helpers') local reset, clear = shada_helpers.reset, shada_helpers.clear @@ -33,7 +34,7 @@ describe('ShaDa support code', function() local vartype = eval('type(g:' .. varname .. ')') -- Exit during `reset` is not a regular exit: it does not write shada -- automatically - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset('set shada+=!') eq(vartype, eval('type(g:' .. varname .. ')')) eq(varval, meths.get_var(varname)) @@ -98,7 +99,7 @@ describe('ShaDa support code', function() meths.set_var('LSTVAR', {'«'}) meths.set_var('DCTVAR', {['«']='«'}) meths.set_var('NESTEDVAR', {['«']={{'«'}, {['«']='«'}, {a='Test'}}}) - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq('«', meths.get_var('STRVAR')) eq({'«'}, meths.get_var('LSTVAR')) @@ -116,7 +117,7 @@ describe('ShaDa support code', function() meths.set_var('DCTVAR', {['«\171']='«\171'}) meths.set_var('NESTEDVAR', {['\171']={{'\171«'}, {['\171']='\171'}, {a='Test'}}}) - nvim_command('qall') + expect_exit(nvim_command, 'qall') reset() eq('\171', meths.get_var('STRVAR')) eq({'\171'}, meths.get_var('LSTVAR')) diff --git a/test/functional/ui/syntax_conceal_spec.lua b/test/functional/ui/syntax_conceal_spec.lua index 9d10c55cb6..f790597140 100644 --- a/test/functional/ui/syntax_conceal_spec.lua +++ b/test/functional/ui/syntax_conceal_spec.lua @@ -4,6 +4,7 @@ local clear, feed, command = helpers.clear, helpers.feed, helpers.command local eq = helpers.eq local insert = helpers.insert local poke_eventloop = helpers.poke_eventloop +local expect_exit = helpers.expect_exit describe('Screen', function() local screen @@ -1003,7 +1004,7 @@ describe('Screen', function() -- test/functional/ui/syntax_conceal_spec.lua. describe('concealed line after window scroll', function() after_each(function() - command(':qall!') + expect_exit(command, ':qall!') os.remove('Xcolesearch') end) diff --git a/third-party/cmake/BuildLuarocks.cmake b/third-party/cmake/BuildLuarocks.cmake index 6d73a02b5a..6933d263f2 100644 --- a/third-party/cmake/BuildLuarocks.cmake +++ b/third-party/cmake/BuildLuarocks.cmake @@ -219,7 +219,7 @@ if(USE_BUNDLED_BUSTED) # nvim-client: https://github.com/neovim/lua-client add_custom_command(OUTPUT ${ROCKS_DIR}/nvim-client COMMAND ${LUAROCKS_BINARY} - ARGS build nvim-client 0.2.3-1 ${LUAROCKS_BUILDARGS} + ARGS build nvim-client 0.2.4-1 ${LUAROCKS_BUILDARGS} DEPENDS luv) add_custom_target(nvim-client DEPENDS ${ROCKS_DIR}/nvim-client)