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/ui/sign_spec.lua | |
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/ui/sign_spec.lua')
-rw-r--r-- | test/functional/ui/sign_spec.lua | 306 |
1 files changed, 31 insertions, 275 deletions
diff --git a/test/functional/ui/sign_spec.lua b/test/functional/ui/sign_spec.lua index 1c0a6f663b..bf2830f2f0 100644 --- a/test/functional/ui/sign_spec.lua +++ b/test/functional/ui/sign_spec.lua @@ -38,16 +38,7 @@ describe('Signs', function() {1:𐌢̀́̂̃̅̄𐌢̀́̂̃̅̄}a | {1:𠜎̀́̂̃̄̅}b | {2: }^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*10 | ]]) end) @@ -64,15 +55,7 @@ describe('Signs', function() {2: }b | {1:>>}c | {2: }^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) end) @@ -85,16 +68,7 @@ describe('Signs', function() a | b | ^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*10 | ]]) end) @@ -115,8 +89,7 @@ describe('Signs', function() {1:>>}b | {2: }c | {2: } | - {0:~ }| - {0:~ }| + {0:~ }|*2 {4:[No Name] [+] }| {2: }{3:a }| {1:>>}b | @@ -145,15 +118,7 @@ describe('Signs', function() {2: }{6: 2 }{8:b }| {2: }{7: 3 }c | {1:>>}{7: 4 }{8:^ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) -- Check that 'statuscolumn' correctly applies numhl @@ -172,16 +137,7 @@ describe('Signs', function() {1:>>}a | {1:>>}b | {8:>>}{3:^c }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*10 | ]]) feed('k') @@ -189,16 +145,7 @@ describe('Signs', function() {1:>>}a | {8:>>}{3:^b }| {1:>>}c | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*10 | ]]) command('set nocursorline') @@ -206,16 +153,7 @@ describe('Signs', function() {1:>>}a | {1:>>}^b | {1:>>}c | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*10 | ]]) command('set cursorline cursorlineopt=line') @@ -223,16 +161,7 @@ describe('Signs', function() {1:>>}a | {1:>>}{3:^b }| {1:>>}c | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*10 | ]]) command('set cursorlineopt=number') @@ -243,15 +172,7 @@ describe('Signs', function() {8:>>}^b | {1:>>}c | {5: } | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) -- Check that 'statuscolumn' cursorline/signcolumn highlights are the same (#21726) @@ -282,15 +203,7 @@ describe('Signs', function() {8:XX}{1:>>}{6: 2 }b | {1:>>}WW{6: 3 }c | {2: }{6: 4 }^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) -- With the default setting, we get the sign with the top id. @@ -300,15 +213,7 @@ describe('Signs', function() {1:>>}{6: 2 }b | WW{6: 3 }c | {2: }{6: 4 }^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) -- "auto:3" accommodates all the signs we defined so far. @@ -318,15 +223,7 @@ describe('Signs', function() {8:XX}{1:>>}{2: }{6: 2 }b | {8:XX}{1:>>}WW{6: 3 }c | {2: }{6: 4 }^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) -- Check "yes:9". @@ -336,15 +233,7 @@ describe('Signs', function() {8:XX}{1:>>}{2: }{6: 2 }b | {8:XX}{1:>>}WW{2: }{6: 3 }c | {2: }{6: 4 }^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) -- Check "auto:N" larger than the maximum number of signs defined in @@ -355,15 +244,7 @@ describe('Signs', function() {8:XX}{1:>>}{2: }{6: 2 }b | {8:XX}{1:>>}WW{6: 3 }c | {2: }{6: 4 }^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]} -- line deletion deletes signs. @@ -373,16 +254,7 @@ describe('Signs', function() {1:>>}{8:XX}{6: 1 }a | {8:XX}{1:>>}{6: 2 }^b | {2: }{6: 3 } | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*10 | ]]) end) @@ -397,15 +269,7 @@ describe('Signs', function() {2: }{6: 2 }b | {2: }{6: 3 }c | {2: }{6: 4 }^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) -- should support up to 8 signs at minimum @@ -415,15 +279,7 @@ describe('Signs', function() {2: }{6: 2 }b | {2: }{6: 3 }c | {2: }{6: 4 }^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) -- should keep the same sign size when signs are not exceeding @@ -436,15 +292,7 @@ describe('Signs', function() {2: }{6: 2 }b | {2: }{6: 3 }c | {2: }{6: 4 }^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) -- should resize itself when signs are exceeding minimum but @@ -457,15 +305,7 @@ describe('Signs', function() {2: }{6: 2 }b | {2: }{6: 3 }c | {2: }{6: 4 }^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) -- should not increase size because sign with existing id is moved @@ -477,15 +317,7 @@ describe('Signs', function() {2: }{6: 2 }b | {2: }{6: 3 }c | {2: }{6: 4 }^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) command('sign place 4 line=1 name=pietSearch buffer=1') @@ -500,15 +332,7 @@ describe('Signs', function() {2: }{6: 2 }b | {2: }{6: 3 }c | {2: }{6: 4 }^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) end) @@ -526,15 +350,7 @@ describe('Signs', function() {6: 2 }b | {6: 3 }c | {6: 4 }^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) -- single column with 1 sign with text and one sign without @@ -544,15 +360,7 @@ describe('Signs', function() {2: }{6: 2 }b | {2: }{6: 3 }c | {2: }{6: 4 }^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) end) @@ -570,15 +378,7 @@ describe('Signs', function() {8: 2 }b | {6: 3 }c | {6: 4 }^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) end) @@ -589,12 +389,7 @@ describe('Signs', function() feed(':sign place<cr>') screen:expect([[ {1:>>} | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*6 {4: }| :sign place | {9:--- Signs ---} | @@ -607,18 +402,7 @@ describe('Signs', function() feed('<cr>') screen:expect([[ {1:>>}^ | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*12 | ]]) end) @@ -636,15 +420,7 @@ describe('Signs', function() {2: }^c | {2: }d | >>e | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) command('sign unplace 10002') @@ -653,15 +429,7 @@ describe('Signs', function() ^c | d | e | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*9 | ]]) end) @@ -680,13 +448,7 @@ describe('Signs', function() {2: }c | {2: }d | >>e | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*7 | ]]) command('sign unplace 10002') @@ -697,13 +459,7 @@ describe('Signs', function() c | d | e | - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| - {0:~ }| + {0:~ }|*7 | ]]) end) |