diff options
author | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 15:00:41 -0700 |
---|---|---|
committer | Josh Rahm <joshuarahm@gmail.com> | 2024-03-09 15:00:41 -0700 |
commit | 7a7f497b483cd65e340064f23ed1c73425ecba0a (patch) | |
tree | d5c99ea22a1e10300d06165f8ac96df6b0dc59e1 /test/functional/core/exit_spec.lua | |
parent | 1b7b916b7631ddf73c38e3a0070d64e4636cb2f3 (diff) | |
parent | ade1b12f49c3b3914c74847d791eb90ea90b56b7 (diff) | |
download | rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.tar.gz rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.tar.bz2 rneovim-7a7f497b483cd65e340064f23ed1c73425ecba0a.zip |
Merge remote-tracking branch 'upstream/master' into aucmd_textputpost
Diffstat (limited to 'test/functional/core/exit_spec.lua')
-rw-r--r-- | test/functional/core/exit_spec.lua | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/test/functional/core/exit_spec.lua b/test/functional/core/exit_spec.lua index d474b77806..d9e3cc3f31 100644 --- a/test/functional/core/exit_spec.lua +++ b/test/functional/core/exit_spec.lua @@ -7,7 +7,7 @@ local feed = helpers.feed local eval = helpers.eval local eq = helpers.eq local run = helpers.run -local funcs = helpers.funcs +local fn = helpers.fn local nvim_prog = helpers.nvim_prog local pcall_err = helpers.pcall_err local exec_capture = helpers.exec_capture @@ -18,7 +18,7 @@ describe('v:exiting', function() before_each(function() helpers.clear() - cid = helpers.nvim('get_api_info')[1] + cid = helpers.api.nvim_get_chan_info(0).id end) it('defaults to v:null', function() @@ -27,8 +27,8 @@ describe('v:exiting', function() local function test_exiting(setup_fn) local function on_setup() - command('autocmd VimLeavePre * call rpcrequest('..cid..', "exit", "VimLeavePre")') - command('autocmd VimLeave * call rpcrequest('..cid..', "exit", "VimLeave")') + command('autocmd VimLeavePre * call rpcrequest(' .. cid .. ', "exit", "VimLeavePre")') + command('autocmd VimLeave * call rpcrequest(' .. cid .. ', "exit", "VimLeave")') setup_fn() end local requests_args = {} @@ -39,7 +39,7 @@ describe('v:exiting', function() return '' end run(on_request, nil, on_setup) - eq({{'VimLeavePre'}, {'VimLeave'}}, requests_args) + eq({ { 'VimLeavePre' }, { 'VimLeave' } }, requests_args) end it('is 0 on normal exit', function() @@ -59,11 +59,16 @@ end) describe(':cquit', function() local function test_cq(cmdline, exit_code, redir_msg) if redir_msg then - eq(redir_msg, pcall_err(function() return exec_capture(cmdline) end)) + eq( + redir_msg, + pcall_err(function() + return exec_capture(cmdline) + end) + ) poke_eventloop() assert_alive() else - funcs.system({nvim_prog, '-u', 'NONE', '-i', 'NONE', '--headless', '--cmd', cmdline}) + fn.system({ nvim_prog, '-u', 'NONE', '-i', 'NONE', '--headless', '--cmd', cmdline }) eq(exit_code, eval('v:shell_error')) end end |