aboutsummaryrefslogtreecommitdiff
path: root/test/functional/ui/embed_spec.lua
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-12-09 20:42:00 +0800
committerzeertzjq <zeertzjq@outlook.com>2023-12-09 22:15:02 +0800
commit1037ce2e461034a20e35ad59969fd05d5ad68b91 (patch)
tree5cc490afac4607008bacf24d132015b63adfd1d0 /test/functional/ui/embed_spec.lua
parent5e43630a260e49ed494539d41cb832b1ee6d03c8 (diff)
downloadrneovim-1037ce2e461034a20e35ad59969fd05d5ad68b91.tar.gz
rneovim-1037ce2e461034a20e35ad59969fd05d5ad68b91.tar.bz2
rneovim-1037ce2e461034a20e35ad59969fd05d5ad68b91.zip
test: avoid repeated screen lines in expected states
This is the command invoked repeatedly to make the changes: :%s/^\(.*\)|\%(\*\(\d\+\)\)\?$\n\1|\%(\*\(\d\+\)\)\?$/\=submatch(1)..'|*'..(max([str2nr(submatch(2)),1])+max([str2nr(submatch(3)),1]))/g
Diffstat (limited to 'test/functional/ui/embed_spec.lua')
-rw-r--r--test/functional/ui/embed_spec.lua35
1 files changed, 7 insertions, 28 deletions
diff --git a/test/functional/ui/embed_spec.lua b/test/functional/ui/embed_spec.lua
index 5917c4fccc..072c9e89ce 100644
--- a/test/functional/ui/embed_spec.lua
+++ b/test/functional/ui/embed_spec.lua
@@ -38,10 +38,7 @@ local function test_embed(ext_linegrid)
it('can display errors', function()
startup('--cmd', 'echoerr invalid+')
screen:expect([[
- |
- |
- |
- |
+ |*4
{6: }|
{7:Error detected while processing pre-vimrc command line:} |
{7:E121: Undefined variable: invalid} |
@@ -51,12 +48,7 @@ local function test_embed(ext_linegrid)
feed('<cr>')
screen:expect([[
^ |
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
+ {3:~ }|*6
|
]])
end)
@@ -67,9 +59,7 @@ local function test_embed(ext_linegrid)
end
startup('--cmd', 'echoerr "foo"', '--cmd', 'color default', '--cmd', 'echoerr "bar"')
screen:expect([[
- |
- |
- |
+ |*3
{9: }|
{7:Error detected while processing pre-vimrc command line:} |
{7:foo} |
@@ -81,9 +71,7 @@ local function test_embed(ext_linegrid)
it("doesn't erase output when setting Normal colors", function()
startup('--cmd', 'echoerr "foo"', '--cmd', 'hi Normal guibg=Green', '--cmd', 'echoerr "bar"')
screen:expect{grid=[[
- |
- |
- |
+ |*3
{6: }|
{7:Error detected while processing pre-vimrc command line:} |
{7:foo} |
@@ -122,11 +110,7 @@ describe('--embed UI', function()
screen:expect{grid=[[
^hello nvim |
from external input |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]]}
@@ -136,10 +120,7 @@ describe('--embed UI', function()
hello nvim |
^ |
from external input |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
{2:-- INSERT --} |
]]}
end)
@@ -208,9 +189,7 @@ describe('--embed --listen UI', function()
child_screen:attach(nil, child_session)
child_screen:expect{grid=[[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{2:[No Name] 0,0-1 All}|
|
]], attr_ids={