aboutsummaryrefslogtreecommitdiff
path: root/test/functional/autocmd
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/autocmd
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/autocmd')
-rw-r--r--test/functional/autocmd/autocmd_spec.lua53
-rw-r--r--test/functional/autocmd/cmdline_spec.lua15
-rw-r--r--test/functional/autocmd/focus_spec.lua12
-rw-r--r--test/functional/autocmd/show_spec.lua5
4 files changed, 15 insertions, 70 deletions
diff --git a/test/functional/autocmd/autocmd_spec.lua b/test/functional/autocmd/autocmd_spec.lua
index 63a487c8bc..b9ece82420 100644
--- a/test/functional/autocmd/autocmd_spec.lua
+++ b/test/functional/autocmd/autocmd_spec.lua
@@ -272,42 +272,22 @@ describe('autocmd', function()
]])
screen:expect([[
^bb |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
|
]])
feed(":enew | doautoall User<cr>")
screen:expect([[
{2:bb }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {3:~ }|*4
+ {1:~ }|*4
^:enew | doautoall User |
]])
feed('<cr>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
13 |
]])
eq(7, eval('g:test'))
@@ -323,28 +303,15 @@ describe('autocmd', function()
feed(":doautoall User<cr>")
screen:expect([[
{2:bb }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {3:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {3:~ }|*4
+ {1:~ }|*4
^:doautoall User |
]])
feed('<cr>')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*8
13 |
]])
-- win vars in aucmd_win should have been reset
@@ -373,11 +340,7 @@ describe('autocmd', function()
]]
screen:expect [[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
{3:[No Name] }|
|
{2:[No Name] }|
diff --git a/test/functional/autocmd/cmdline_spec.lua b/test/functional/autocmd/cmdline_spec.lua
index 82fb9b9444..577ee53c9d 100644
--- a/test/functional/autocmd/cmdline_spec.lua
+++ b/test/functional/autocmd/cmdline_spec.lua
@@ -68,9 +68,7 @@ describe('cmdline autocommands', function()
feed(':')
screen:expect([[
|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*3
{4: }|
: |
{2:CmdlineEnter Autocommands for "*": Vim(echoerr):FAIL} |
@@ -94,11 +92,7 @@ describe('cmdline autocommands', function()
screen:expect([[
|
^lorem ipsum |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*5
|
]])
@@ -160,10 +154,7 @@ describe('cmdline autocommands', function()
|
lorem ipsum |
^lorem ipsum. |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end)
diff --git a/test/functional/autocmd/focus_spec.lua b/test/functional/autocmd/focus_spec.lua
index 204bfcaa12..6a5cdbb96e 100644
--- a/test/functional/autocmd/focus_spec.lua
+++ b/test/functional/autocmd/focus_spec.lua
@@ -40,9 +40,7 @@ describe('autoread TUI FocusGained/FocusLost', function()
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:[No Name] }|
|
{3:-- TERMINAL --} |
@@ -50,9 +48,7 @@ describe('autoread TUI FocusGained/FocusLost', function()
feed_command('edit '..path)
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:xtest-foo }|
:edit xtest-foo |
{3:-- TERMINAL --} |
@@ -61,9 +57,7 @@ describe('autoread TUI FocusGained/FocusLost', function()
feed_data('\027[O')
screen:expect{grid=[[
{1: } |
- {4:~ }|
- {4:~ }|
- {4:~ }|
+ {4:~ }|*3
{5:xtest-foo }|
:edit xtest-foo |
{3:-- TERMINAL --} |
diff --git a/test/functional/autocmd/show_spec.lua b/test/functional/autocmd/show_spec.lua
index 9e0a5b819a..437b664bf5 100644
--- a/test/functional/autocmd/show_spec.lua
+++ b/test/functional/autocmd/show_spec.lua
@@ -79,10 +79,7 @@ describe(":autocmd", function()
feed('q')
screen:expect([[
^ |
- {1:~ }|
- {1:~ }|
- {1:~ }|
- {1:~ }|
+ {1:~ }|*4
|
]])
end)