diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/terminal/tui_spec.lua | 18 | ||||
-rw-r--r-- | test/functional/ui/screen.lua | 2 |
2 files changed, 19 insertions, 1 deletions
diff --git a/test/functional/terminal/tui_spec.lua b/test/functional/terminal/tui_spec.lua index 89704be820..15fcfd52da 100644 --- a/test/functional/terminal/tui_spec.lua +++ b/test/functional/terminal/tui_spec.lua @@ -85,6 +85,24 @@ describe('TUI', function() assert_alive() end) + it('resize at startup', function() + -- Issues: #17285 #15044 #11330 + screen:try_resize(50, 10) + feed_command([[call termopen([v:progpath, '--clean', '--cmd', 'let start = reltime() | while v:true | if reltimefloat(reltime(start)) > 2 | break | endif | endwhile']) | sleep 500m | vs new]]) + screen:expect([[ + {1: } │ | + {4:~ }│{4:~ }| + {4:~ }│{4:~ }| + {4:~ }│{4:~ }| + {4:~ }│{4:~ }| + {4:~ }│{5:[No Name] 0,0-1 All}| + {4:~ }│ | + {5:new }{MATCH:<.*[/\]nvim }| + | + {3:-- TERMINAL --} | + ]]) + end) + it('accepts resize while pager is active', function() child_session:request("nvim_command", [[ set more diff --git a/test/functional/ui/screen.lua b/test/functional/ui/screen.lua index e628fcea01..ea98705394 100644 --- a/test/functional/ui/screen.lua +++ b/test/functional/ui/screen.lua @@ -383,7 +383,7 @@ function Screen:expect(expected, attr_ids, ...) for i, row in ipairs(expected_rows) do msg_expected_rows[i] = row local m = (row ~= actual_rows[i] and row:match('{MATCH:(.*)}') or nil) - if row ~= actual_rows[i] and (not m or not actual_rows[i]:match(m)) then + if row ~= actual_rows[i] and (not m or not (actual_rows[i] and actual_rows[i]:match(m))) then msg_expected_rows[i] = '*' .. msg_expected_rows[i] if i <= #actual_rows then actual_rows[i] = '*' .. actual_rows[i] |