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.lua86
1 files changed, 61 insertions, 25 deletions
diff --git a/test/functional/terminal/window_spec.lua b/test/functional/terminal/window_spec.lua
index eec8b53f4d..842a81872e 100644
--- a/test/functional/terminal/window_spec.lua
+++ b/test/functional/terminal/window_spec.lua
@@ -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
+local iswin = helpers.iswin
describe('terminal window', function()
local screen
@@ -12,36 +12,72 @@ 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 |
- ]])
+ describe("with 'number'", function()
+ it('wraps text', function()
+ feed([[<C-\><C-N>]])
+ feed([[:set numberwidth=1 number<CR>i]])
+ screen:expect([[
+ {7:1 }tty ready |
+ {7:2 }rows: 6, cols: 48 |
+ {7:3 }{1: } |
+ {7:4 } |
+ {7:5 } |
+ {7:6 } |
+ {3:-- TERMINAL --} |
+ ]])
+ thelpers.feed_data({'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'})
+ screen:expect([[
+ {7:1 }tty ready |
+ {7:2 }rows: 6, cols: 48 |
+ {7:3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUV|
+ {7:4 }WXYZ{1: } |
+ {7:5 } |
+ {7:6 } |
+ {3:-- TERMINAL --} |
+ ]])
+
+ if iswin() then
+ return -- win: :terminal resize is unreliable #7007
+ end
+
+ -- numberwidth=9
+ feed([[<C-\><C-N>]])
+ feed([[:set numberwidth=9 number<CR>i]])
+ screen:expect([[
+ {7: 1 }tty ready |
+ {7: 2 }rows: 6, cols: 48 |
+ {7: 3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO|
+ {7: 4 }WXYZrows: 6, cols: 41 |
+ {7: 5 }{1: } |
+ {7: 6 } |
+ {3:-- TERMINAL --} |
+ ]])
+ thelpers.feed_data({' abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'})
+ screen:expect([[
+ {7: 1 }tty ready |
+ {7: 2 }rows: 6, cols: 48 |
+ {7: 3 }abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNO|
+ {7: 4 }WXYZrows: 6, cols: 41 |
+ {7: 5 } abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMN|
+ {7: 6 }OPQRSTUVWXYZ{1: } |
+ {3:-- TERMINAL --} |
+ ]])
+ end)
end)
- describe('with colorcolumn set', function()
+ describe("with 'colorcolumn'", function()
before_each(function()
- feed('<c-\\><c-n>')
+ feed([[<C-\><C-N>]])
screen:expect([[
tty ready |
- {2: } |
+ {2:^ } |
+ |
|
|
|
- ^ |
|
]])
- feed(':set colorcolumn=20<cr>i')
+ feed(':set colorcolumn=20<CR>i')
end)
it('wont show the color column', function()
@@ -52,14 +88,14 @@ describe('terminal window', function()
|
|
|
- -- TERMINAL -- |
+ {3:-- TERMINAL --} |
]])
end)
end)
describe('with fold set', function()
before_each(function()
- feed('<c-\\><c-n>:set foldenable foldmethod=manual<cr>i')
+ feed([[<C-\><C-N>:set foldenable foldmethod=manual<CR>i]])
thelpers.feed_data({'line1', 'line2', 'line3', 'line4', ''})
screen:expect([[
tty ready |
@@ -68,12 +104,12 @@ describe('terminal window', function()
line3 |
line4 |
{1: } |
- -- TERMINAL -- |
+ {3:-- TERMINAL --} |
]])
end)
it('wont show any folds', function()
- feed('<c-\\><c-n>ggvGzf')
+ feed([[<C-\><C-N>ggvGzf]])
wait()
screen:expect([[
^tty ready |