Skip to content

Commit

Permalink
fix(tests): update legacy tab switch test to be sane
Browse files Browse the repository at this point in the history
  • Loading branch information
bfredl committed Apr 5, 2022
1 parent 463174b commit 6dc31ee
Showing 1 changed file with 59 additions and 7 deletions.
66 changes: 59 additions & 7 deletions test/functional/legacy/cmdline_spec.lua
Expand Up @@ -11,6 +11,15 @@ describe('cmdline', function()
it('is cleared when switching tabs', function()
local screen = Screen.new(30, 10)
screen:attach()
screen:set_default_attr_ids {
[1] = {underline = true, background = Screen.colors.LightGrey};
[2] = {bold = true};
[3] = {reverse = true};
[4] = {bold = true, foreground = Screen.colors.Blue1};
}
-- TODO(bfredl): redraw with tabs is severly broken. fix it
feed_command [[ set display-=msgsep ]]

feed_command([[call setline(1, range(30))]])
screen:expect([[
^0 |
Expand All @@ -24,15 +33,58 @@ describe('cmdline', function()
8 |
:call setline(1, range(30)) |
]])
feed([[:tabnew<cr><C-w>-<C-w>-gtgt]])

feed [[:tabnew<cr>]]
screen:expect{grid=[[
{1: + [No Name] }{2: [No Name] }{3: }{1:X}|
^ |
{4:~ }|
{4:~ }|
{4:~ }|
{4:~ }|
{4:~ }|
{4:~ }|
{4:~ }|
:tabnew |
]]}

feed [[<C-w>-<C-w>-]]
screen:expect{grid=[[
{1: + [No Name] }{2: [No Name] }{3: }{1:X}|
^ |
{4:~ }|
{4:~ }|
{4:~ }|
{4:~ }|
{4:~ }|
|
|
:tabnew |
]]}

feed [[gt]]
screen:expect{grid=[[
{2: + [No Name] }{1: [No Name] }{3: }{1:X}|
^0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
|
]]}

feed [[gt]]
screen:expect([[
+ [No Name] [No Name] X|
{1: + [No Name] }{2: [No Name] }{3: }{1:X}|
^ |
~ |
~ |
~ |
~ |
~ |
{4:~ }|
{4:~ }|
{4:~ }|
{4:~ }|
{4:~ }|
|
|
|
Expand Down

0 comments on commit 6dc31ee

Please sign in to comment.