diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-12-09 20:42:00 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-12-09 22:15:02 +0800 |
commit | 1037ce2e461034a20e35ad59969fd05d5ad68b91 (patch) | |
tree | 5cc490afac4607008bacf24d132015b63adfd1d0 /test/functional/core | |
parent | 5e43630a260e49ed494539d41cb832b1ee6d03c8 (diff) | |
download | rneovim-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/core')
-rw-r--r-- | test/functional/core/fileio_spec.lua | 9 | ||||
-rw-r--r-- | test/functional/core/job_spec.lua | 13 | ||||
-rw-r--r-- | test/functional/core/main_spec.lua | 14 | ||||
-rw-r--r-- | test/functional/core/startup_spec.lua | 26 |
4 files changed, 16 insertions, 46 deletions
diff --git a/test/functional/core/fileio_spec.lua b/test/functional/core/fileio_spec.lua index 456650be6a..5ae468e560 100644 --- a/test/functional/core/fileio_spec.lua +++ b/test/functional/core/fileio_spec.lua @@ -271,8 +271,7 @@ describe('fileio', function() command("e Xtest-overwrite-forced") screen:expect([[ ^foobar | - {1:~ }| - {1:~ }| + {1:~ }|*2 "Xtest-overwrite-forced" [noeol] 1L, 6B | ]]) @@ -296,16 +295,14 @@ describe('fileio', function() feed("<cr>") screen:expect([[ ^foobar | - {1:~ }| - {1:~ }| + {1:~ }|*2 | ]]) -- Use a screen test because the warning does not set v:errmsg. command("w!") screen:expect([[ ^foobar | - {1:~ }| - {1:~ }| + {1:~ }|*2 <erwrite-forced" [noeol] 1L, 6B written | ]]) end) diff --git a/test/functional/core/job_spec.lua b/test/functional/core/job_spec.lua index d2ea0b7441..6d021fb73f 100644 --- a/test/functional/core/job_spec.lua +++ b/test/functional/core/job_spec.lua @@ -894,8 +894,7 @@ describe('jobs', function() feed_command('call PrintAndWait()') screen:expect{grid=[[ | - {0:~ }| - {0:~ }| + {0:~ }|*2 {1: }| aaa | bbb | @@ -1151,10 +1150,7 @@ describe("pty process teardown", function() screen:attach() screen:expect([[ ^ | - ~ | - ~ | - ~ | - ~ | + ~ |*4 | ]]) end) @@ -1173,10 +1169,7 @@ describe("pty process teardown", function() screen:expect([[ ^ | [Process exited 0] | - | - | - | - | + |*4 ]]) end) end) diff --git a/test/functional/core/main_spec.lua b/test/functional/core/main_spec.lua index 37d659739c..723bcbe153 100644 --- a/test/functional/core/main_spec.lua +++ b/test/functional/core/main_spec.lua @@ -73,10 +73,7 @@ describe('command-line option', function() }) screen:expect([[ {1:^ }| - {2:~ }| - {2:~ }| - {2:~ }| - {2:~ }| + {2:~ }|*4 {3:[No Name] 0,0-1 All}| {1: }| | @@ -89,11 +86,7 @@ describe('command-line option', function() screen:expect([[ | [Process exited 1] | - | - | - | - | - | + |*5 -- TERMINAL -- | ]]) --[=[ Example of incorrect output: @@ -104,8 +97,7 @@ describe('command-line option', function() LENO' failed. | | [Process exited 6] | - | - | + |*2 ]]) ]=] end) diff --git a/test/functional/core/startup_spec.lua b/test/functional/core/startup_spec.lua index 54259d2f5a..44e71c4946 100644 --- a/test/functional/core/startup_spec.lua +++ b/test/functional/core/startup_spec.lua @@ -49,8 +49,7 @@ describe('startup', function() funcs.termopen({ nvim_prog, '-u', 'NONE', '--server', eval('v:servername'), '--remote-ui' }) screen:expect([[ ^Cannot attach UI of :terminal child to its parent. (Unset $NVIM to skip this check) | - | - | + |*2 ]]) end) @@ -92,12 +91,9 @@ describe('startup', function() funcs.chansend(id, 'cont\n') screen:expect([[ ^ | - ~ | - ~ | - ~ | + ~ |*3 [No Name] | - | - | + |*2 ]]) end) end) @@ -497,11 +493,9 @@ describe('startup', function() funcs.chansend(id, '\n') screen:expect([[ ^ | - ~ | - ~ | + ~ |*2 [No Name] | - | - | + |*2 ]]) end) @@ -907,10 +901,7 @@ describe('user config init', function() feed('ia') screen:expect([[ | - ~ | - ~ | - ~ | - ~ | + ~ |*4 [No Name] 0,0-1 All| | -- TERMINAL -- | @@ -918,10 +909,7 @@ describe('user config init', function() feed(':echo g:exrc_file<CR>') screen:expect(string.format([[ | - ~ | - ~ | - ~ | - ~ | + ~ |*4 [No Name] 0,0-1 All| %s%s| -- TERMINAL -- | |