diff options
Diffstat (limited to 'test/functional/terminal')
-rw-r--r-- | test/functional/terminal/helpers.lua | 2 | ||||
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 79 | ||||
-rw-r--r-- | test/functional/terminal/window_spec.lua | 16 |
3 files changed, 93 insertions, 4 deletions
diff --git a/test/functional/terminal/helpers.lua b/test/functional/terminal/helpers.lua index 2d99a08614..9e450cc264 100644 --- a/test/functional/terminal/helpers.lua +++ b/test/functional/terminal/helpers.lua @@ -56,6 +56,8 @@ local function screen_setup(extra_rows, command, cols, opts) [8] = {foreground = 15, background = 1}, -- error message [9] = {foreground = 4}, [10] = {foreground = 121}, -- "Press ENTER" in embedded :terminal session. + [11] = {foreground = tonumber('0x00000b')}, + [12] = {reverse = true, foreground = tonumber('0x000079')}, }) screen:attach(opts or {rgb=false}) diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 07c91d43e1..cbf113d062 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -89,6 +89,85 @@ describe('TUI', function() eq(2, eval("1+1")) -- Still alive? end) + it('accepts resize while pager is active', function() + child_session:request("nvim_command", [[ + set more + func! ManyErr() + for i in range(10) + echoerr "FAIL ".i + endfor + endfunc + ]]) + feed_data(':call ManyErr()\r') + screen:expect{grid=[[ + {8:Error detected while processing function ManyErr:} | + {11:line 2:} | + {8:FAIL 0} | + {8:FAIL 1} | + {8:FAIL 2} | + {10:-- More --}{1: } | + {3:-- TERMINAL --} | + ]]} + + feed_data('d') + screen:expect{grid=[[ + {8:FAIL 1} | + {8:FAIL 2} | + {8:FAIL 3} | + {8:FAIL 4} | + {8:FAIL 5} | + {10:-- More --}{1: } | + {3:-- TERMINAL --} | + ]]} + + screen:try_resize(50,5) + screen:expect{grid=[[ + {8:FAIL 1} | + {8:FAIL 2} | + {8:FAIL 3} | + {10:-- More -- SPACE/d/j: screen/page/line down, b/u/}{12:k}| + {3:-- TERMINAL --} | + ]]} + + -- TODO(bfredl): messes up the output (just like vim does). + feed_data('g') + screen:expect{grid=[[ + {8:FAIL 1} ) | + {8:Error detected while processing function ManyErr:} | + {11:line 2:} | + {10:-- More --}{1: } | + {3:-- TERMINAL --} | + ]]} + + screen:try_resize(50,10) + screen:expect{grid=[[ + {8:FAIL 1} ) | + {8:Error detected while processing function ManyErr:} | + {11:line 2:} | + {10:-- More --} | + {10: }| + {10: }| + {10: }| + {10: }| + {10:-- More -- SPACE/d/j: screen/page/line down, b/u/}{12:k}| + {3:-- TERMINAL --} | + ]]} + + feed_data('\003') + screen:expect{grid=[[ + {1: } | + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + {4:~ }| + {5:[No Name] }| + | + {3:-- TERMINAL --} | + ]]} + end) + it('accepts basic utf-8 input', function() feed_data('iabc\ntest1\ntest2') screen:expect([[ diff --git a/test/functional/terminal/window_spec.lua b/test/functional/terminal/window_spec.lua index 4f62c75433..f1c828d17e 100644 --- a/test/functional/terminal/window_spec.lua +++ b/test/functional/terminal/window_spec.lua @@ -158,7 +158,7 @@ describe(':terminal with multigrid', function() [2:--------------------------------------------------]| [2:--------------------------------------------------]| [2:--------------------------------------------------]| - {3:-- TERMINAL --} | + [3:--------------------------------------------------]| ## grid 2 tty ready | {1: } | @@ -166,6 +166,8 @@ describe(':terminal with multigrid', function() | | | + ## grid 3 + {3:-- TERMINAL --} | ]]) screen:try_resize_grid(2, 20, 10) @@ -180,7 +182,7 @@ describe(':terminal with multigrid', function() [2:--------------------------------------------------]| [2:--------------------------------------------------]| [2:--------------------------------------------------]| - {3:-- TERMINAL --} | + [3:--------------------------------------------------]| ## grid 2 tty ready | rows: 10, cols: 20 | @@ -192,6 +194,8 @@ describe(':terminal with multigrid', function() | | | + ## grid 3 + {3:-- TERMINAL --} | ]]) end @@ -207,11 +211,13 @@ describe(':terminal with multigrid', function() [2:--------------------------------------------------]| [2:--------------------------------------------------]| [2:--------------------------------------------------]| - {3:-- TERMINAL --} | + [3:--------------------------------------------------]| ## grid 2 rows: 10, cols: 20 | rows: 3, cols: 70 | {1: } | + ## grid 3 + {3:-- TERMINAL --} | ]]) end @@ -227,7 +233,7 @@ describe(':terminal with multigrid', function() [2:--------------------------------------------------]| [2:--------------------------------------------------]| [2:--------------------------------------------------]| - {3:-- TERMINAL --} | + [3:--------------------------------------------------]| ## grid 2 tty ready | rows: 10, cols: 20 | @@ -235,6 +241,8 @@ describe(':terminal with multigrid', function() rows: 6, cols: 50 | {1: } | | + ## grid 3 + {3:-- TERMINAL --} | ]]) end end) |