aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/scrollback_spec.lua
diff options
context:
space:
mode:
authorGregory Anders <greg@gpanders.com>2021-09-04 15:28:08 -0600
committerGregory Anders <greg@gpanders.com>2023-08-10 09:08:25 -0500
commit673ee213e9d0900b1fa2638dc5373ee8167ed4fa (patch)
tree94abb447f78f33d4367f5848444993074f23214f /test/functional/terminal/scrollback_spec.lua
parent0c89854da1893c9d9d5da1994bea69df31fc2a6f (diff)
downloadrneovim-673ee213e9d0900b1fa2638dc5373ee8167ed4fa.tar.gz
rneovim-673ee213e9d0900b1fa2638dc5373ee8167ed4fa.tar.bz2
rneovim-673ee213e9d0900b1fa2638dc5373ee8167ed4fa.zip
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.
Diffstat (limited to 'test/functional/terminal/scrollback_spec.lua')
-rw-r--r--test/functional/terminal/scrollback_spec.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/test/functional/terminal/scrollback_spec.lua b/test/functional/terminal/scrollback_spec.lua
index d20f5177b8..ba0b663285 100644
--- a/test/functional/terminal/scrollback_spec.lua
+++ b/test/functional/terminal/scrollback_spec.lua
@@ -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_.