aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/multigrid_spec.lua
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2018-11-17 18:23:42 +0100
committerBjörn Linse <bjorn.linse@gmail.com>2018-12-31 16:24:07 +0100
commited3da23cf45f5484e6c62fac9a4d3f2986fc20d5 (patch)
tree40f7d17b466563a98e23a75c52498ba60df04348 /test/functional/ui/multigrid_spec.lua
parent13f74635fa3ad2030b7452665f389d366a1995cf (diff)
downloadrneovim-ed3da23cf45f5484e6c62fac9a4d3f2986fc20d5.tar.gz
rneovim-ed3da23cf45f5484e6c62fac9a4d3f2986fc20d5.tar.bz2
rneovim-ed3da23cf45f5484e6c62fac9a4d3f2986fc20d5.zip
multigrid: test refactor
Diffstat (limited to 'test/functional/ui/multigrid_spec.lua')
-rw-r--r--test/functional/ui/multigrid_spec.lua555
1 files changed, 313 insertions, 242 deletions
diff --git a/test/functional/ui/multigrid_spec.lua b/test/functional/ui/multigrid_spec.lua
index 6a4d956404..fcc736651f 100644
--- a/test/functional/ui/multigrid_spec.lua
+++ b/test/functional/ui/multigrid_spec.lua
@@ -44,18 +44,18 @@ describe('multigrid screen', function()
it('default initial screen', function()
screen:expect([[
## grid 1
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
{11:[No Name] }|
|
## grid 2
@@ -78,18 +78,18 @@ describe('multigrid screen', function()
command('vsplit')
screen:expect([[
## grid 1
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
{11:[No Name] }{12:[No Name] }|
|
## grid 2
@@ -128,18 +128,18 @@ describe('multigrid screen', function()
command('split')
screen:expect([[
## grid 1
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│}{11:[No Name] }|
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
+ [3:--------------------------]{12:│}[4:--------------------------]|
+ [3:--------------------------]{12:│}[4:--------------------------]|
+ [3:--------------------------]{12:│}[4:--------------------------]|
+ [3:--------------------------]{12:│}[4:--------------------------]|
+ [3:--------------------------]{12:│}[4:--------------------------]|
+ [3:--------------------------]{12:│}[4:--------------------------]|
+ [3:--------------------------]{12:│}{11:[No Name] }|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
{12:[No Name] [No Name] }|
|
## grid 2
@@ -179,18 +179,18 @@ describe('multigrid screen', function()
command('q')
screen:expect([[
## grid 1
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
+ [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|
+ [4:-----------------------------------------------------]|
{11:[No Name] }|
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
{12:[No Name] }|
|
## grid 2
@@ -220,18 +220,18 @@ describe('multigrid screen', function()
command('sp')
screen:expect([[
## grid 1
- |
- |
- |
- |
- |
- |
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
{11:[No Name] }|
- |
- |
- |
- |
- |
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
{12:[No Name] }|
|
## grid 2
@@ -253,21 +253,20 @@ describe('multigrid screen', function()
it('resizes grids', function ()
command('sp')
command('resize 8')
- -- see "Note 1" for info about why there are three statuslines
screen:expect([[
## grid 1
- |
- |
- |
- |
- |
- |
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
{11:[No Name] }|
- |
- {11:[No Name] }|
- |
- |
- |
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
{12:[No Name] }|
|
## grid 2
@@ -292,18 +291,18 @@ describe('multigrid screen', function()
command('vsp')
screen:expect([[
## grid 1
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
+ [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]|
+ [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]|
+ [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]|
+ [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]|
+ [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]|
+ [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]|
{11:[No Name] }{12:[No Name] [No Name] }|
- |
- |
- |
- |
- |
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
{12:[No Name] }|
|
## grid 2
@@ -337,18 +336,18 @@ describe('multigrid screen', function()
insert('hello')
screen:expect([[
## grid 1
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
+ [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]|
+ [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]|
+ [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]|
+ [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]|
+ [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]|
+ [5:--------------------]{12:│}[4:----------------]{12:│}[3:---------------]|
{11:[No Name] [+] }{12:[No Name] [+] [No Name] [+] }|
- |
- |
- |
- |
- |
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
{12:[No Name] [+] }|
|
## grid 2
@@ -382,21 +381,51 @@ describe('multigrid screen', function()
end)
it('closes splits', function ()
command('sp')
- command('q')
screen:expect([[
## grid 1
- |
- |
- |
- |
- |
- |
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
+ [3:-----------------------------------------------------]|
{11:[No Name] }|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ {12:[No Name] }|
|
+ ## grid 2
|
- |
- |
- |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ ## grid 3
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ ]])
+ command('q')
+ screen:expect([[
+ ## grid 1
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
{11:[No Name] }|
|
## grid 2
@@ -421,18 +450,18 @@ describe('multigrid screen', function()
command('vsp')
screen:expect([[
## grid 1
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
{11:[No Name] }{12:[No Name] }|
|
## grid 2
@@ -469,18 +498,18 @@ describe('multigrid screen', function()
-- see "Note 1" for info about why there are two vseps
screen:expect([[
## grid 1
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
- {12:│} {12:│} |
+ [3:----------]{12:│}[2:------------------------------------------]|
+ [3:----------]{12:│}[2:------------------------------------------]|
+ [3:----------]{12:│}[2:------------------------------------------]|
+ [3:----------]{12:│}[2:------------------------------------------]|
+ [3:----------]{12:│}[2:------------------------------------------]|
+ [3:----------]{12:│}[2:------------------------------------------]|
+ [3:----------]{12:│}[2:------------------------------------------]|
+ [3:----------]{12:│}[2:------------------------------------------]|
+ [3:----------]{12:│}[2:------------------------------------------]|
+ [3:----------]{12:│}[2:------------------------------------------]|
+ [3:----------]{12:│}[2:------------------------------------------]|
+ [3:----------]{12:│}[2:------------------------------------------]|
{11:<No Name] }{12:[No Name] }|
|
## grid 2
@@ -516,18 +545,18 @@ describe('multigrid screen', function()
command('sp')
screen:expect([[
## grid 1
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {11:[No Name] }{12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
+ [4:--------------------------]{12:│}[2:--------------------------]|
+ [4:--------------------------]{12:│}[2:--------------------------]|
+ [4:--------------------------]{12:│}[2:--------------------------]|
+ [4:--------------------------]{12:│}[2:--------------------------]|
+ [4:--------------------------]{12:│}[2:--------------------------]|
+ [4:--------------------------]{12:│}[2:--------------------------]|
+ {11:[No Name] }{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
{12:[No Name] [No Name] }|
|
## grid 2
@@ -560,18 +589,18 @@ describe('multigrid screen', function()
insert('hello')
screen:expect([[
## grid 1
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {11:[No Name] [+] }{12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
+ [4:--------------------------]{12:│}[2:--------------------------]|
+ [4:--------------------------]{12:│}[2:--------------------------]|
+ [4:--------------------------]{12:│}[2:--------------------------]|
+ [4:--------------------------]{12:│}[2:--------------------------]|
+ [4:--------------------------]{12:│}[2:--------------------------]|
+ [4:--------------------------]{12:│}[2:--------------------------]|
+ {11:[No Name] [+] }{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
{12:[No Name] [+] [No Name] [+] }|
|
## grid 2
@@ -600,26 +629,68 @@ describe('multigrid screen', function()
{1:~ }|
{1:~ }|
{1:~ }|
- ]])
+ ]])
end)
it('closes splits', function ()
command('vsp')
+ screen:expect([[
+ ## grid 1
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ [3:--------------------------]{12:│}[2:--------------------------]|
+ {11:[No Name] }{12:[No Name] }|
+ |
+ ## grid 2
+ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ ## grid 3
+ ^ |
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ {1:~ }|
+ ]])
command('q')
- -- see "Note 1" for info about why there is a vsep
screen:expect([[
## grid 1
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
- {12:│} |
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
{11:[No Name] }|
|
## grid 2
@@ -645,10 +716,10 @@ describe('multigrid screen', function()
screen:try_resize(25, 6)
screen:expect([[
## grid 1
- |
- |
- |
- |
+ [2:-------------------------]|
+ [2:-------------------------]|
+ [2:-------------------------]|
+ [2:-------------------------]|
{11:[No Name] }|
|
## grid 2
@@ -663,7 +734,7 @@ describe('multigrid screen', function()
screen:try_resize(1, 1)
screen:expect([[
## grid 1
- |
+ [2:------------]|
{11:[No Name] }|
|
## grid 2
@@ -673,7 +744,7 @@ describe('multigrid screen', function()
feed('<esc>:ls')
screen:expect([[
## grid 1
- |
+ [2:------------]|
{11:[No Name] }|
:ls^ |
## grid 2
@@ -687,18 +758,18 @@ describe('multigrid screen', function()
screen:try_resize_grid(2, 8, 5)
screen:expect([[
## grid 1
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
{11:[No Name] }|
|
## grid 2
@@ -716,18 +787,18 @@ describe('multigrid screen', function()
screen:try_resize_grid(2, 80, 20)
screen:expect([[
## grid 1
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
{11:[No Name] }|
|
## grid 2
@@ -763,18 +834,18 @@ describe('multigrid screen', function()
insert(('a'):rep(60).."\n")
screen:expect([[
## grid 1
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
{11:[No Name] [+] }|
|
## grid 2
@@ -805,18 +876,18 @@ describe('multigrid screen', function()
insert(('b'):rep(80).."\n")
screen:expect([[
## grid 1
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
{11:[No Name] [+] }|
|
## grid 2
@@ -848,18 +919,18 @@ describe('multigrid screen', function()
' long message"')
screen:expect([[
## grid 1
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
{11:[No Name] }|
this is a very very very...ry very very long message |
## grid 2
@@ -891,18 +962,18 @@ describe('multigrid screen', function()
feed('kzfgg')
screen:expect([[
## grid 1
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
+ [2:-----------------------------------------------------]|
{11:[No Name] [+] }|
|
## grid 2