mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Add tests for new feature
This commit is contained in:
@@ -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>')
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user