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/options | |
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/options')
-rw-r--r-- | test/functional/options/chars_spec.lua | 41 | ||||
-rw-r--r-- | test/functional/options/cursorbind_spec.lua | 25 | ||||
-rw-r--r-- | test/functional/options/defaults_spec.lua | 3 | ||||
-rw-r--r-- | test/functional/options/shortmess_spec.lua | 28 |
4 files changed, 23 insertions, 74 deletions
diff --git a/test/functional/options/chars_spec.lua b/test/functional/options/chars_spec.lua index a082204980..9800a21e60 100644 --- a/test/functional/options/chars_spec.lua +++ b/test/functional/options/chars_spec.lua @@ -27,36 +27,27 @@ describe("'fillchars'", function() eq('', eval('&fillchars')) screen:expect([[ ^ | - ~ | - ~ | - ~ | + ~ |*3 | ]]) end) it('supports whitespace', function() screen:expect([[ ^ | - ~ | - ~ | - ~ | + ~ |*3 | ]]) command('set fillchars=eob:\\ ') screen:expect([[ ^ | - | - | - | - | + |*4 ]]) end) it('supports multibyte char', function() command('set fillchars=eob:ñ') screen:expect([[ ^ | - ñ | - ñ | - ñ | + ñ |*3 | ]]) end) @@ -77,9 +68,7 @@ describe("'fillchars'", function() command('set fillchars=fold:x') screen:expect([[ ^+-- 2 lines: fooxxxxxxxx│+-- 2 lines: fooxxxxxxx| - ~ │~ | - ~ │~ | - ~ │~ | + ~ │~ |*3 | ]]) end) @@ -92,9 +81,7 @@ describe("'fillchars'", function() command('setl fillchars=fold:x') screen:expect([[ ^+-- 2 lines: fooxxxxxxxx│+-- 2 lines: foo·······| - ~ │~ | - ~ │~ | - ~ │~ | + ~ │~ |*3 | ]]) end) @@ -108,9 +95,7 @@ describe("'fillchars'", function() command('set fillchars&') screen:expect([[ ^+-- 2 lines: foo········│+-- 2 lines: fooxxxxxxx| - ~ │~ | - ~ │~ | - ~ │~ | + ~ │~ |*3 | ]]) end) @@ -132,9 +117,7 @@ describe("'listchars'", function() command('set listchars=tab:<->') screen:expect([[ <------><------>^<------> │<------><------><------>| - ~ │~ | - ~ │~ | - ~ │~ | + ~ │~ |*3 | ]]) end) @@ -146,9 +129,7 @@ describe("'listchars'", function() command('setl listchars<') screen:expect([[ > > ^> │<------><------><------>| - ~ │~ | - ~ │~ | - ~ │~ | + ~ │~ |*3 | ]]) end) @@ -160,9 +141,7 @@ describe("'listchars'", function() command('set listchars=tab:>-,eol:$') screen:expect([[ >------->-------^>-------$│<------><------><------>| - ~ │~ | - ~ │~ | - ~ │~ | + ~ │~ |*3 | ]]) end) diff --git a/test/functional/options/cursorbind_spec.lua b/test/functional/options/cursorbind_spec.lua index 498206936a..0dfac100ee 100644 --- a/test/functional/options/cursorbind_spec.lua +++ b/test/functional/options/cursorbind_spec.lua @@ -32,10 +32,7 @@ describe("'cursorbind'", function() feed('20l') screen:expect([[ a bb cc dd ee ff gg │aa bb cc dd ee ff gg^ hh ii jj kk ll mm | - {4: }│ {4: } | - {4: }│ {4: } | - {4: }│ {4: } | - {4: }│ {4: } | + {4: }│ {4: } |*4 {1:~ }│{1:~ }| {3:[No Name] [+] }{2:[No Name] [+] }| | @@ -43,10 +40,7 @@ describe("'cursorbind'", function() feed('10l') screen:expect([[ hh ii jj kk ll mm n│aa bb cc dd ee ff gg hh ii jj ^kk ll mm | - {4: } │ {4: } | - {4: } │ {4: } | - {4: } │ {4: } | - {4: } │ {4: } | + {4: } │ {4: } |*4 {1:~ }│{1:~ }| {3:[No Name] [+] }{2:[No Name] [+] }| | @@ -56,10 +50,7 @@ describe("'cursorbind'", function() feed('20l') screen:expect([[ {4:a bb cc dd ee ff gg }│{4:aa bb cc dd ee ff gg^ hh ii jj kk ll mm }| - {4: }│ {4: } | - {4: }│ {4: } | - {4: }│ {4: } | - {4: }│ {4: } | + {4: }│ {4: } |*4 {1:~ }│{1:~ }| {3:[No Name] [+] }{2:[No Name] [+] }| | @@ -67,10 +58,7 @@ describe("'cursorbind'", function() feed('10l') screen:expect([[ {4: hh ii jj kk ll mm n}│{4:aa bb cc dd ee ff gg hh ii jj ^kk ll mm }| - {4: } │ {4: } | - {4: } │ {4: } | - {4: } │ {4: } | - {4: } │ {4: } | + {4: } │ {4: } |*4 {1:~ }│{1:~ }| {3:[No Name] [+] }{2:[No Name] [+] }| | @@ -80,10 +68,7 @@ describe("'cursorbind'", function() feed('40l') screen:expect([[ kk ll mm nn oo pp qq│ bb cc dd ee ff gg hh ii jj kk ll mm n^n| - │ | - │ | - │ | - │ | + │ |*4 {1:~ }│{1:~ }| {3:[No Name] [+] }{2:[No Name] [+] }| | diff --git a/test/functional/options/defaults_spec.lua b/test/functional/options/defaults_spec.lua index 7858b626de..4a0aa7d023 100644 --- a/test/functional/options/defaults_spec.lua +++ b/test/functional/options/defaults_spec.lua @@ -32,8 +32,7 @@ describe('startup defaults', function() command('filetype') screen:expect([[ ^ | - ~ | - ~ | + ~ |*2 ]]..expected ) end diff --git a/test/functional/options/shortmess_spec.lua b/test/functional/options/shortmess_spec.lua index a56e9c09b4..6bc00ca1c5 100644 --- a/test/functional/options/shortmess_spec.lua +++ b/test/functional/options/shortmess_spec.lua @@ -22,9 +22,7 @@ describe("'shortmess'", function() feed(':edit foo<CR>') screen:expect([[ ^ | - ~ | - ~ | - ~ | + ~ |*3 "foo" [New] | ]]) eq(1, eval('bufnr("%")')) @@ -33,9 +31,7 @@ describe("'shortmess'", function() feed(':edit bar<CR>') screen:expect([[ ^ | - ~ | - ~ | - ~ | + ~ |*3 :edit bar | ]]) eq(2, eval('bufnr("%")')) @@ -47,27 +43,21 @@ describe("'shortmess'", function() feed(':edit foo<CR>') screen:expect([[ ^ | - ~ | - ~ | - ~ | + ~ |*3 "foo" [New] | ]]) eq(1, eval('bufnr("%")')) feed(':edit bar<CR>') screen:expect([[ ^ | - ~ | - ~ | - ~ | + ~ |*3 "bar" [New] | ]]) eq(2, eval('bufnr("%")')) feed(':bprevious<CR>') screen:expect([[ ^ | - ~ | - ~ | - ~ | + ~ |*3 "foo" [New] --No lines in buffer-- | ]]) eq(1, eval('bufnr("%")')) @@ -76,18 +66,14 @@ describe("'shortmess'", function() feed(':bnext<CR>') screen:expect([[ ^ | - ~ | - ~ | - ~ | + ~ |*3 :bnext | ]]) eq(2, eval('bufnr("%")')) feed(':bprevious<CR>') screen:expect([[ ^ | - ~ | - ~ | - ~ | + ~ |*3 :bprevious | ]]) eq(1, eval('bufnr("%")')) |