From 1037ce2e461034a20e35ad59969fd05d5ad68b91 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Sat, 9 Dec 2023 20:42:00 +0800 Subject: 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 --- test/functional/legacy/normal_spec.lua | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'test/functional/legacy/normal_spec.lua') diff --git a/test/functional/legacy/normal_spec.lua b/test/functional/legacy/normal_spec.lua index ba875460f5..df96d64708 100644 --- a/test/functional/legacy/normal_spec.lua +++ b/test/functional/legacy/normal_spec.lua @@ -18,22 +18,13 @@ describe('normal', function() ]]) screen:expect([[ {1: 2 }222222222222222222222222222222222222| - {1: }222222222222222222222222222222222222| - {1: }222222222222222222222222222222222222| - {1: }222222222222222222222222222222222222| - {1: }222222222222222222222222222222222222| + {1: }222222222222222222222222222222222222|*4 {1: }22222222222222222222 | {1: 3 }333333333333333333333333333333333333| - {1: }333333333333333333333333333333333333| - {1: }333333333333333333333333333333333333| - {1: }333333333333333333333333333333333333| - {1: }333333333333333333333333333333333333| + {1: }333333333333333333333333333333333333|*4 {1: }33333333333333333333 | {1: 4 }^444444444444444444444444444444444444| - {1: }444444444444444444444444444444444444| - {1: }444444444444444444444444444444444444| - {1: }444444444444444444444444444444444444| - {1: }444444444444444444444444444444444444| + {1: }444444444444444444444444444444444444|*4 {1: }44444444444444444444 | | ]]) -- cgit From 04f2f864e270e772c6326cefdf24947f0130e492 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Wed, 3 Jan 2024 02:09:18 +0100 Subject: refactor: format test/* --- test/functional/legacy/normal_spec.lua | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'test/functional/legacy/normal_spec.lua') diff --git a/test/functional/legacy/normal_spec.lua b/test/functional/legacy/normal_spec.lua index df96d64708..1dddeed033 100644 --- a/test/functional/legacy/normal_spec.lua +++ b/test/functional/legacy/normal_spec.lua @@ -7,16 +7,18 @@ before_each(clear) describe('normal', function() -- oldtest: Test_normal_j_below_botline() - it([["j" does not skip lines when scrolling below botline and 'foldmethod' is not "manual"]], function() - local screen = Screen.new(40, 19) - screen:attach() - screen:set_default_attr_ids({{foreground = Screen.colors.Brown}}) - exec([[ + it( + [["j" does not skip lines when scrolling below botline and 'foldmethod' is not "manual"]], + function() + local screen = Screen.new(40, 19) + screen:attach() + screen:set_default_attr_ids({ { foreground = Screen.colors.Brown } }) + exec([[ set number foldmethod=diff scrolloff=0 call setline(1, map(range(1, 9), 'repeat(v:val, 200)')) norm Lj ]]) - screen:expect([[ + screen:expect([[ {1: 2 }222222222222222222222222222222222222| {1: }222222222222222222222222222222222222|*4 {1: }22222222222222222222 | @@ -28,5 +30,6 @@ describe('normal', function() {1: }44444444444444444444 | | ]]) - end) + end + ) end) -- cgit