test: update tests for auto-closing :term buffers

The terminal buffer closes automatically when using `:terminal` and the
command exits without an error. This messes up some tests that expect
the terminal buffer to still be open. We can force the buffer not to
close by passing an argument to `:terminal`. This can be anything, since
the shell-test stub simply prints whatever argument it's given.
This commit is contained in:
Gregory Anders
2021-09-04 15:28:08 -06:00
parent 0c89854da1
commit 673ee213e9
4 changed files with 30 additions and 20 deletions

View File

@@ -514,7 +514,9 @@ describe("'scrollback' option", function()
-- _Global_ scrollback=-1 defaults :terminal to 10_000.
command('setglobal scrollback=-1')
command('terminal')
-- Pass a command to prevent the terminal buffer from automatically
-- closing. The ':' command is just a no-op.
command('terminal :')
eq(10000, meths.get_option_value('scrollback', {}))
-- _Local_ scrollback=-1 in :terminal forces the _maximum_.