diff options
author | Gregory Anders <greg@gpanders.com> | 2021-08-16 21:06:49 -0600 |
---|---|---|
committer | Justin M. Keyes <justinkz@gmail.com> | 2021-08-31 06:46:56 -0700 |
commit | 55defa1a41baac65cd32dc499b330af9751d6c5b (patch) | |
tree | 5f3baed6de0eaf28d451a7ad20ff06da8b24de68 /test/functional/terminal/buffer_spec.lua | |
parent | 9695691ee4868ea9fdd8a6d84b9980fc22c77aa3 (diff) | |
download | rneovim-55defa1a41baac65cd32dc499b330af9751d6c5b.tar.gz rneovim-55defa1a41baac65cd32dc499b330af9751d6c5b.tar.bz2 rneovim-55defa1a41baac65cd32dc499b330af9751d6c5b.zip |
fix(terminal): close without ! if the job is stopped
- If the terminal job is still running then ! is still required.
Closes #4683
Diffstat (limited to 'test/functional/terminal/buffer_spec.lua')
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index c61bf108cb..16f7fe5178 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -7,6 +7,12 @@ local eq, neq = helpers.eq, helpers.neq local write_file = helpers.write_file local command= helpers.command local exc_exec = helpers.exc_exec +local retry = helpers.retry +local funcs = helpers.funcs +local pesc = helpers.pesc +local matches = helpers.matches +local nvim_dir = helpers.nvim_dir +local iswin = helpers.iswin describe(':terminal buffer', function() local screen @@ -255,8 +261,14 @@ describe(':terminal buffer', function() command('bdelete!') end) - it('handles wqall', function() + it("requires bang (!) to close a running job", function() + local cwd = funcs.fnamemodify('.', ':p:~'):gsub([[[\/]*$]], '') + local ext_pat = iswin() and '%.EXE' or '' eq('Vim(wqall):E948: Job still running', exc_exec('wqall')) + matches('^Vim%(bdelete%):E89: term://'..pesc(cwd)..'//%d+:'..nvim_dir..'/tty%-test'..ext_pat..' will be killed %(add %! to override%)$', exc_exec('bdelete')) + command('call jobstop(&channel)') + retry(nil, nil, function() assert(0 >= eval('jobwait([&channel], 1000)[0]')) end) + command('bdelete') end) it('does not segfault when pasting empty buffer #13955', function() |