From: Steve Hancock Date: Sun, 2 Jan 2022 02:31:09 +0000 (-0800) Subject: add test cases for -vxl X-Git-Tag: 20211029.05~10 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=075d48dc47d7022278e0109d13d09d4c7486c69e;p=perltidy.git add test cases for -vxl --- diff --git a/CHANGES.md b/CHANGES.md index e8bc99ca..2381365a 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,6 +2,10 @@ ## 2021 10 29.04 + - Two new flags have been added to provide finer vertical alignment control, + --valign-exclusion-list=s (-vxl=s) and --valign-inclusion-list=s (-vil=s). + This has been requested several times, recently in git #79. + - A new flag -gal=s, --grep-alias-list=s, has been added as suggested in git #77. This allows code blocks passed to list operator functions to be formatted in the same way as a code block passed to grep, map, or sort. diff --git a/t/snippets/expect/vxl.def b/t/snippets/expect/vxl.def new file mode 100644 index 00000000..27a32ca8 --- /dev/null +++ b/t/snippets/expect/vxl.def @@ -0,0 +1,5 @@ +# if equals is excluded then ternary is automatically excluded +# side comment alignments always remain +$co_description = ($color) ? 'bold cyan' : ''; # description +$co_prompt = ($color) ? 'bold green' : ''; # prompt +$co_unused = ($color) ? 'on_green' : 'reverse'; # unused diff --git a/t/snippets/expect/vxl.vxl1 b/t/snippets/expect/vxl.vxl1 new file mode 100644 index 00000000..b3b5c8c3 --- /dev/null +++ b/t/snippets/expect/vxl.vxl1 @@ -0,0 +1,5 @@ +# if equals is excluded then ternary is automatically excluded +# side comment alignments always remain +$co_description = ($color) ? 'bold cyan' : ''; # description +$co_prompt = ($color) ? 'bold green' : ''; # prompt +$co_unused = ($color) ? 'on_green' : 'reverse'; # unused diff --git a/t/snippets/expect/vxl.vxl2 b/t/snippets/expect/vxl.vxl2 new file mode 100644 index 00000000..8eb4aed2 --- /dev/null +++ b/t/snippets/expect/vxl.vxl2 @@ -0,0 +1,5 @@ +# if equals is excluded then ternary is automatically excluded +# side comment alignments always remain +$co_description = ($color) ? 'bold cyan' : ''; # description +$co_prompt = ($color) ? 'bold green' : ''; # prompt +$co_unused = ($color) ? 'on_green' : 'reverse'; # unused diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt index 1b67a931..2aa01294 100644 --- a/t/snippets/packing_list.txt +++ b/t/snippets/packing_list.txt @@ -482,3 +482,6 @@ ../snippets9.t rt98902.def ../snippets9.t rt98902.rt98902 ../snippets9.t rt99961.def +../snippets25.t vxl.def +../snippets25.t vxl.vxl1 +../snippets25.t vxl.vxl2 diff --git a/t/snippets/vxl.in b/t/snippets/vxl.in new file mode 100644 index 00000000..8eb4aed2 --- /dev/null +++ b/t/snippets/vxl.in @@ -0,0 +1,5 @@ +# if equals is excluded then ternary is automatically excluded +# side comment alignments always remain +$co_description = ($color) ? 'bold cyan' : ''; # description +$co_prompt = ($color) ? 'bold green' : ''; # prompt +$co_unused = ($color) ? 'on_green' : 'reverse'; # unused diff --git a/t/snippets/vxl1.par b/t/snippets/vxl1.par new file mode 100644 index 00000000..ef5305a4 --- /dev/null +++ b/t/snippets/vxl1.par @@ -0,0 +1 @@ +-vxl='=' diff --git a/t/snippets/vxl2.par b/t/snippets/vxl2.par new file mode 100644 index 00000000..c9bbecc2 --- /dev/null +++ b/t/snippets/vxl2.par @@ -0,0 +1 @@ +-vxl='*' -vil='=' diff --git a/t/snippets25.t b/t/snippets25.t index 2e15c49c..38ba5de0 100644 --- a/t/snippets25.t +++ b/t/snippets25.t @@ -16,6 +16,9 @@ #13 git74.git74 #14 git77.def #15 git77.git77 +#16 vxl.def +#17 vxl.vxl1 +#18 vxl.vxl2 # To locate test #13 you can search for its name or the string '#13' @@ -64,7 +67,13 @@ BEGIN { 'novalign2' => "-nvsc -nvbc -msc=2", 'novalign3' => "-nvc", 'rt140025' => "-lp -xci -ci=4 -ce", - 'xlp1' => "-xlp", + 'vxl1' => <<'----------', +-vxl='=' +---------- + 'vxl2' => <<'----------', +-vxl='*' -vil='=' +---------- + 'xlp1' => "-xlp", }; ############################ @@ -249,6 +258,14 @@ my $cmd; } } }; +---------- + + 'vxl' => <<'----------', +# if equals is excluded then ternary is automatically excluded +# side comment alignments always remain +$co_description = ($color) ? 'bold cyan' : ''; # description +$co_prompt = ($color) ? 'bold green' : ''; # prompt +$co_unused = ($color) ? 'on_green' : 'reverse'; # unused ---------- 'xlp1' => <<'----------', @@ -706,6 +723,42 @@ my $test_var = }; #15........... }, + + 'vxl.def' => { + source => "vxl", + params => "def", + expect => <<'#16...........', +# if equals is excluded then ternary is automatically excluded +# side comment alignments always remain +$co_description = ($color) ? 'bold cyan' : ''; # description +$co_prompt = ($color) ? 'bold green' : ''; # prompt +$co_unused = ($color) ? 'on_green' : 'reverse'; # unused +#16........... + }, + + 'vxl.vxl1' => { + source => "vxl", + params => "vxl1", + expect => <<'#17...........', +# if equals is excluded then ternary is automatically excluded +# side comment alignments always remain +$co_description = ($color) ? 'bold cyan' : ''; # description +$co_prompt = ($color) ? 'bold green' : ''; # prompt +$co_unused = ($color) ? 'on_green' : 'reverse'; # unused +#17........... + }, + + 'vxl.vxl2' => { + source => "vxl", + params => "vxl2", + expect => <<'#18...........', +# if equals is excluded then ternary is automatically excluded +# side comment alignments always remain +$co_description = ($color) ? 'bold cyan' : ''; # description +$co_prompt = ($color) ? 'bold green' : ''; # prompt +$co_unused = ($color) ? 'on_green' : 'reverse'; # unused +#18........... + }, }; my $ntests = 0 + keys %{$rtests};