aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/window_spec.lua
diff options
context:
space:
mode:
Diffstat (limited to 'test/functional/terminal/window_spec.lua')
-rw-r--r--test/functional/terminal/window_spec.lua21
1 files changed, 19 insertions, 2 deletions
diff --git a/test/functional/terminal/window_spec.lua b/test/functional/terminal/window_spec.lua
index 242377f9bd..c220b0c5a4 100644
--- a/test/functional/terminal/window_spec.lua
+++ b/test/functional/terminal/window_spec.lua
@@ -3,8 +3,12 @@ local thelpers = require('test.functional.terminal.helpers')
local feed, clear = helpers.feed, helpers.clear
local wait = helpers.wait
local iswin = helpers.iswin
+local command = helpers.command
+local retry = helpers.retry
+local eq = helpers.eq
+local eval = helpers.eval
-describe('terminal window', function()
+describe(':terminal window', function()
local screen
before_each(function()
@@ -12,6 +16,19 @@ describe('terminal window', function()
screen = thelpers.screen_setup()
end)
+ it('sets topline correctly #8556', function()
+ -- Test has hardcoded assumptions of dimensions.
+ eq(7, eval('&lines'))
+ command('set shell=sh')
+ command('terminal')
+ retry(nil, nil, function() assert(nil ~= eval('b:terminal_job_pid')) end)
+ -- Terminal/shell contents must exceed the height of this window.
+ command('topleft 1split')
+ feed([[i<cr>]])
+ -- Check topline _while_ in terminal-mode.
+ retry(nil, nil, function() eq(6, eval('winsaveview()["topline"]')) end)
+ end)
+
describe("with 'number'", function()
it('wraps text', function()
feed([[<C-\><C-N>]])
@@ -124,7 +141,7 @@ describe('terminal window', function()
end)
end)
-describe('terminal window with multigrid', function()
+describe(':terminal with multigrid', function()
local screen
before_each(function()