diff options
Diffstat (limited to 'test/functional/terminal/buffer_spec.lua')
-rw-r--r-- | test/functional/terminal/buffer_spec.lua | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/test/functional/terminal/buffer_spec.lua b/test/functional/terminal/buffer_spec.lua index c61bf108cb..103ae59b8e 100644 --- a/test/functional/terminal/buffer_spec.lua +++ b/test/functional/terminal/buffer_spec.lua @@ -1,5 +1,6 @@ local helpers = require('test.functional.helpers')(after_each) local thelpers = require('test.functional.terminal.helpers') +local assert_alive = helpers.assert_alive local feed, clear, nvim = helpers.feed, helpers.clear, helpers.nvim local poke_eventloop = helpers.poke_eventloop local eval, feed_command, source = helpers.eval, helpers.feed_command, helpers.source @@ -7,6 +8,7 @@ local eq, neq = helpers.eq, helpers.neq local write_file = helpers.write_file local command= helpers.command local exc_exec = helpers.exc_exec +local matches = helpers.matches describe(':terminal buffer', function() local screen @@ -255,8 +257,23 @@ describe(':terminal buffer', function() command('bdelete!') end) - it('handles wqall', function() + it('requires bang (!) to close a running job #15402', function() eq('Vim(wqall):E948: Job still running', exc_exec('wqall')) + for _, cmd in ipairs({ 'bdelete', '%bdelete', 'bwipeout', 'bunload' }) do + matches('^Vim%('..cmd:gsub('%%', '')..'%):E89: term://.*tty%-test.* will be killed %(add %! to override%)$', + exc_exec(cmd)) + end + command('call jobstop(&channel)') + assert(0 >= eval('jobwait([&channel], 1000)[0]')) + command('bdelete') + end) + + it('stops running jobs with :quit', function() + -- Open in a new window to avoid terminating the nvim instance + command('split') + command('terminal') + command('set nohidden') + command('quit') end) it('does not segfault when pasting empty buffer #13955', function() @@ -284,7 +301,7 @@ describe('No heap-buffer-overflow when using', function() feed('$') -- Let termopen() modify the buffer feed_command('call termopen("echo")') - eq(2, eval('1+1')) -- check nvim still running + assert_alive() feed_command('bdelete!') end) end) @@ -294,6 +311,6 @@ describe('No heap-buffer-overflow when', function() feed_command('set nowrap') feed_command('autocmd TermOpen * startinsert') feed_command('call feedkeys("4000ai\\<esc>:terminal!\\<cr>")') - eq(2, eval('1+1')) + assert_alive() end) end) |