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/treesitter/highlight_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/treesitter/highlight_spec.lua')
-rw-r--r-- | test/functional/treesitter/highlight_spec.lua | 117 |
1 files changed, 14 insertions, 103 deletions
diff --git a/test/functional/treesitter/highlight_spec.lua b/test/functional/treesitter/highlight_spec.lua index e037c9e215..01f92de0d6 100644 --- a/test/functional/treesitter/highlight_spec.lua +++ b/test/functional/treesitter/highlight_spec.lua @@ -100,17 +100,7 @@ local injection_grid_c = [[ return 42; \ | } | ^ | - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| + {1:~ }|*11 | ]] @@ -121,17 +111,7 @@ local injection_grid_expected_c = [[ {4:return} {5:42}; \ | } | ^ | - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| + {1:~ }|*11 | ]] @@ -178,8 +158,7 @@ describe('treesitter highlighting (C)', function() 1, (void *)(ptrdiff_t)cb); | return 0; | ^} | - {1:~ }| - {1:~ }| + {1:~ }|*2 | ]]} @@ -204,8 +183,7 @@ describe('treesitter highlighting (C)', function() {5:1}, ({3:void} *)({3:ptrdiff_t})cb); | {4:return} {5:0}; | ^} | - {1:~ }| - {1:~ }| + {1:~ }|*2 | ]]} @@ -227,8 +205,7 @@ describe('treesitter highlighting (C)', function() {5:1}, ({3:void} *)({3:ptrdiff_t})cb); | {4:return} {5:0}; | } | - {1:~ }| - {1:~ }| + {1:~ }|*2 | ]]} @@ -366,8 +343,7 @@ describe('treesitter highlighting (C)', function() {4:for} ({3:UIExtension} i = {5:0}; ({3:int})i < kUIExtCount; i++) { | {4:for} ({3:size_t} i = {5:0}; i < ui_count; i++) { | {3:int} width = {5:INT_MAX}, height = {5:INT_MAX}; | - } | - } | + } |*2 {3:void} ui_refresh({3:void}) | :sort | ]]} @@ -517,17 +493,7 @@ describe('treesitter highlighting (C)', function() {4:return} {5:42}; \ | } | ^ | - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| + {1:~ }|*11 | ]]} end) @@ -556,8 +522,7 @@ describe('treesitter highlighting (C)', function() {5:1}, ({3:void} *)({3:ptrdiff_t})cb); | {4:return} {5:0}; | ^} | - {1:~ }| - {1:~ }| + {1:~ }|*2 | ]]} @@ -580,8 +545,7 @@ describe('treesitter highlighting (C)', function() {5:1}, ({3:void} *)({3:ptrdiff_t})cb); | {4:return} {5:0}; | ^} | - {1:~ }| - {1:~ }| + {1:~ }|*2 | ]]} screen:expect{ unchanged=true } @@ -608,17 +572,7 @@ describe('treesitter highlighting (C)', function() {8: }{12:return}{8: 42; \} | {8: }} | ^ | - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| + {1:~ }|*11 | ]], attr_ids={ [1] = {bold = true, foreground = Screen.colors.Blue1}; @@ -641,21 +595,7 @@ describe('treesitter highlighting (C)', function() screen:expect{grid=[[ char* x = "Will somebody ever read this?"; | ^ | - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| + {1:~ }|*15 | ]]} @@ -672,21 +612,7 @@ describe('treesitter highlighting (C)', function() screen:expect{grid=[[ {3:char}* x = {5:"Will somebody ever read this?"}; | ^ | - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| + {1:~ }|*15 | ]]} @@ -695,21 +621,7 @@ describe('treesitter highlighting (C)', function() screen:expect{grid=[[ {5:char}* x = {5:"Will somebody ever read this?"}; | ^ | - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| - {1:~ }| + {1:~ }|*15 | ]]} end) @@ -747,8 +659,7 @@ describe('treesitter highlighting (C)', function() 1, (void *)(ptrdiff_t)cb); | return 0; | ^} | - {1:~ }| - {1:~ }| + {1:~ }|*2 | ]]} end) |