Add tests for new feature

This commit is contained in:
Marco Hinz
2016-06-20 20:47:23 +02:00
parent a05e7a6bca
commit 1a8d9e9d54
2 changed files with 62 additions and 1 deletions

View File

@@ -2,7 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
local thelpers = require('test.functional.terminal.helpers')
local feed, clear = helpers.feed, helpers.clear
local wait = helpers.wait
local execute = helpers.execute
describe('terminal window', function()
local screen
@@ -12,6 +12,23 @@ describe('terminal window', function()
screen = thelpers.screen_setup()
end)
it('resets its size when entering terminal buffer', function()
feed('<c-\\><c-n>')
execute('set hidden')
execute('edit foo')
execute('doautoall SessionLoadPost')
execute('silent bnext')
screen:expect([[
tty ready |
{2: } |
|
|
|
^ |
:silent bnext |
]])
end)
describe('with colorcolumn set', function()
before_each(function()
feed('<c-\\><c-n>')

View File

@@ -2,6 +2,7 @@ local helpers = require('test.functional.helpers')(after_each)
local thelpers = require('test.functional.terminal.helpers')
local clear = helpers.clear
local feed, nvim = helpers.feed, helpers.nvim
local execute = helpers.execute
describe('terminal', function()
local screen
@@ -21,6 +22,49 @@ describe('terminal', function()
screen:detach()
end)
it('resets its size when entering terminal window', function()
feed('<c-\\><c-n>')
execute('2split')
screen:expect([[
tty ready |
^rows: 2, cols: 50 |
========== |
tty ready |
rows: 2, cols: 50 |
{2: } |
~ |
~ |
========== |
|
]])
execute('wincmd p')
screen:expect([[
tty ready |
rows: 2, cols: 50 |
========== |
tty ready |
rows: 2, cols: 50 |
rows: 5, cols: 50 |
{2: } |
^ |
========== |
:wincmd p |
]])
execute('wincmd p')
screen:expect([[
rows: 5, cols: 50 |
^rows: 2, cols: 50 |
========== |
rows: 5, cols: 50 |
rows: 2, cols: 50 |
{2: } |
~ |
~ |
========== |
:wincmd p |
]])
end)
describe('when the screen is resized', function()
it('will forward a resize request to the program', function()
screen:try_resize(screen._width + 3, screen._height + 5)