aboutsummaryrefslogtreecommitdiff
path: root/test/functional/terminal/tui_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-09-01 11:25:00 +0200
committerBjörn Linse <bjorn.linse@gmail.com>2019-09-01 15:55:10 +0200
commite04b9e7c78bdcf40cce5b5533ce8d7695691dfd6 (patch)
tree39dd100dccde24ce0b8af578e134b5d2b945faa9 /test/functional/terminal/tui_spec.lua
parentb51ba122c1edfb769e72c25c4f14f469f59f1b8e (diff)
downloadrneovim-e04b9e7c78bdcf40cce5b5533ce8d7695691dfd6.tar.gz
rneovim-e04b9e7c78bdcf40cce5b5533ce8d7695691dfd6.tar.bz2
rneovim-e04b9e7c78bdcf40cce5b5533ce8d7695691dfd6.zip
test/ui: update tests for new msg_grid implementation
Diffstat (limited to 'test/functional/terminal/tui_spec.lua')
-rw-r--r--test/functional/terminal/tui_spec.lua79
1 files changed, 79 insertions, 0 deletions
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([[