From b52c7c586f881d8cc81b6282bc66556218938351 Mon Sep 17 00:00:00 2001 From: Steve Hancock Date: Mon, 15 Jul 2024 13:05:31 -0700 Subject: [PATCH] fix test file names --- bin/perltidy | 25 ++-- t/snippets/{atlc.in => altc.in} | 0 t/snippets/{atlc1.par => altc1.par} | 0 t/snippets/{atlc2.par => altc2.par} | 0 t/snippets/{dtlc.in => dltc.in} | 0 t/snippets/{dtlc1.par => dltc1.par} | 0 t/snippets/{dtlc2.par => dltc2.par} | 0 t/snippets/expect/{atlc.atlc1 => altc.altc1} | 0 t/snippets/expect/{atlc.atlc2 => altc.altc2} | 0 t/snippets/expect/{atlc.def => altc.def} | 0 t/snippets/expect/{dtlc.def => dltc.def} | 0 t/snippets/expect/{dtlc.dtlc1 => dltc.dltc1} | 0 t/snippets/expect/{dtlc.dtlc2 => dltc.dltc2} | 0 t/snippets/packing_list.txt | 12 +- t/snippets30.t | 132 +++++++++---------- 15 files changed, 84 insertions(+), 85 deletions(-) rename t/snippets/{atlc.in => altc.in} (100%) rename t/snippets/{atlc1.par => altc1.par} (100%) rename t/snippets/{atlc2.par => altc2.par} (100%) rename t/snippets/{dtlc.in => dltc.in} (100%) rename t/snippets/{dtlc1.par => dltc1.par} (100%) rename t/snippets/{dtlc2.par => dltc2.par} (100%) rename t/snippets/expect/{atlc.atlc1 => altc.altc1} (100%) rename t/snippets/expect/{atlc.atlc2 => altc.altc2} (100%) rename t/snippets/expect/{atlc.def => altc.def} (100%) rename t/snippets/expect/{dtlc.def => dltc.def} (100%) rename t/snippets/expect/{dtlc.dtlc1 => dltc.dltc1} (100%) rename t/snippets/expect/{dtlc.dtlc2 => dltc.dltc2} (100%) diff --git a/bin/perltidy b/bin/perltidy index 840f259a..2d7ac299 100755 --- a/bin/perltidy +++ b/bin/perltidy @@ -3794,7 +3794,7 @@ trailing commas but they are not required. Including them can sometimes simplify the maintenance of large or complex lists. By default, perltidy does not add or delete trailing commas, but it is possible to manipulate them with the -following set of three related parameters: +following set of related parameters: =over 4 @@ -3942,8 +3942,8 @@ B Adding or deleting the only comma in a list can have some implications which need to be explained and possibly controlled. -The main issue with deleting a lone comma is that if the only comma in a list -is deleted, then it might not be possible to later add it back automatically +The main issue with deleting a lone comma is that if it +is deleted, then it might not be possible add it back automatically since perltidy uses the existance of commas to help locate lists. For example, given @@ -3957,7 +3957,7 @@ and if we remove the comma with then we cannot use the trailing comma controls to add this comma back. The parameter B<--delete-lone-trailing-commas> allows such a comma to be deleted, and is on by default, but can be turned off to prevent this. This might -be useful is if one is experimenting with formatting options and wants +be useful if one is experimenting with formatting options and wants to restrict testing to operations which are reversible. Note that this parameter is a fine-tuning control for B<--delete-trailing-commas> which must also be set for it to have any effect. @@ -3975,12 +3975,11 @@ the following snippet: ); However, the parameter B<--add-lone-trailing-commas> must be set to allow such -a comma to be added. This parameter is off by default. The reason is that -adding such a comma would prevent the B<--weld-nested-containers> flag from -operating on this structure. This can be confusing, or undesirable if the -welding control is also being used. Note that this parameter is a fine-tuning -control for B<--add-trailing-commas> which must also be set for it to have any -effect. To illustrate its use: +a comma to be added. The reason is that adding such a comma would prevent the +B<--weld-nested-containers> flag from operating on this structure. This can be +confusing, so this parameter is off by default. Note that this parameter is a +fine-tuning control for B<--add-trailing-commas> which must also be set for it +to have any effect. To illustrate its use on the above example: # perltidy -atc -altc -wtc=b $self->make_grammar( @@ -3991,8 +3990,8 @@ effect. To illustrate its use: }, ); -If we later decide we would prefer to remove this comma to allow welding, -it can be removed with the control in the next section. +This comma can be removed to allow welding with the control described in the +next section. =item B<-dwic>, B<--delete-weld-interfering-commas> @@ -4010,7 +4009,7 @@ For example, a comma in this script prevents welding: }, ); -Using B<-dwic> removes the comma and allows welding: +Adding B<-dwic> removes the comma and allows welding: # perltidy -wn -dwic $self->make_grammar( { diff --git a/t/snippets/atlc.in b/t/snippets/altc.in similarity index 100% rename from t/snippets/atlc.in rename to t/snippets/altc.in diff --git a/t/snippets/atlc1.par b/t/snippets/altc1.par similarity index 100% rename from t/snippets/atlc1.par rename to t/snippets/altc1.par diff --git a/t/snippets/atlc2.par b/t/snippets/altc2.par similarity index 100% rename from t/snippets/atlc2.par rename to t/snippets/altc2.par diff --git a/t/snippets/dtlc.in b/t/snippets/dltc.in similarity index 100% rename from t/snippets/dtlc.in rename to t/snippets/dltc.in diff --git a/t/snippets/dtlc1.par b/t/snippets/dltc1.par similarity index 100% rename from t/snippets/dtlc1.par rename to t/snippets/dltc1.par diff --git a/t/snippets/dtlc2.par b/t/snippets/dltc2.par similarity index 100% rename from t/snippets/dtlc2.par rename to t/snippets/dltc2.par diff --git a/t/snippets/expect/atlc.atlc1 b/t/snippets/expect/altc.altc1 similarity index 100% rename from t/snippets/expect/atlc.atlc1 rename to t/snippets/expect/altc.altc1 diff --git a/t/snippets/expect/atlc.atlc2 b/t/snippets/expect/altc.altc2 similarity index 100% rename from t/snippets/expect/atlc.atlc2 rename to t/snippets/expect/altc.altc2 diff --git a/t/snippets/expect/atlc.def b/t/snippets/expect/altc.def similarity index 100% rename from t/snippets/expect/atlc.def rename to t/snippets/expect/altc.def diff --git a/t/snippets/expect/dtlc.def b/t/snippets/expect/dltc.def similarity index 100% rename from t/snippets/expect/dtlc.def rename to t/snippets/expect/dltc.def diff --git a/t/snippets/expect/dtlc.dtlc1 b/t/snippets/expect/dltc.dltc1 similarity index 100% rename from t/snippets/expect/dtlc.dtlc1 rename to t/snippets/expect/dltc.dltc1 diff --git a/t/snippets/expect/dtlc.dtlc2 b/t/snippets/expect/dltc.dltc2 similarity index 100% rename from t/snippets/expect/dtlc.dtlc2 rename to t/snippets/expect/dltc.dltc2 diff --git a/t/snippets/packing_list.txt b/t/snippets/packing_list.txt index bd32abd7..97d86f4c 100644 --- a/t/snippets/packing_list.txt +++ b/t/snippets/packing_list.txt @@ -444,14 +444,14 @@ ../snippets3.t gnu1.def ../snippets30.t git143.def ../snippets30.t git143.git143 -../snippets30.t atlc.atlc1 -../snippets30.t atlc.atlc2 -../snippets30.t atlc.def -../snippets30.t dtlc.def -../snippets30.t dtlc.dtlc1 -../snippets30.t dtlc.dtlc2 ../snippets30.t git146.def ../snippets30.t git146.git146 +../snippets30.t altc.altc1 +../snippets30.t altc.altc2 +../snippets30.t altc.def +../snippets30.t dltc.def +../snippets30.t dltc.dltc1 +../snippets30.t dltc.dltc2 ../snippets4.t gnu1.gnu ../snippets4.t gnu2.def ../snippets4.t gnu2.gnu diff --git a/t/snippets30.t b/t/snippets30.t index be08287c..35455a9c 100644 --- a/t/snippets30.t +++ b/t/snippets30.t @@ -3,14 +3,14 @@ # Contents: #1 git143.def #2 git143.git143 -#3 atlc.atlc1 -#4 atlc.atlc2 -#5 atlc.def -#6 dtlc.def -#7 dtlc.dtlc1 -#8 dtlc.dtlc2 -#9 git146.def -#10 git146.git146 +#3 git146.def +#4 git146.git146 +#5 altc.altc1 +#6 altc.altc2 +#7 altc.def +#8 dltc.def +#9 dltc.dltc1 +#10 dltc.dltc2 # To locate test #13 you can search for its name or the string '#13' @@ -28,11 +28,11 @@ BEGIN { # BEGIN SECTION 1: Parameter combinations # ########################################### $rparams = { - 'atlc1' => "-atc -wtc=m", - 'atlc2' => "-altc -atc -wtc=m", + 'altc1' => "-atc -wtc=m", + 'altc2' => "-altc -atc -wtc=m", 'def' => "", - 'dtlc1' => "-dtc -wtc=0", - 'dtlc2' => "-dtc -wtc=0 -ndltc", + 'dltc1' => "-dtc -wtc=0", + 'dltc2' => "-dtc -wtc=0 -ndltc", 'git143' => "-atc -wtc=h", 'git146' => <<'----------', # testing three dash parameters @@ -47,7 +47,7 @@ BEGIN { ############################ $rsources = { - 'atlc' => <<'----------', + 'altc' => <<'----------', $self->make_grammar( { iterator => $self->_iterator, @@ -57,7 +57,7 @@ $self->make_grammar( ); ---------- - 'dtlc' => <<'----------', + 'dltc' => <<'----------', $self->make_grammar( { iterator => $self->_iterator, @@ -120,51 +120,49 @@ $self->make_grammar( #2........... }, - 'atlc.atlc1' => { - source => "atlc", - params => "atlc1", + 'git146.def' => { + source => "git146", + params => "def", expect => <<'#3...........', -$self->make_grammar( - { - iterator => $self->_iterator, - parser => $self, - version => $self->version, - } -); + my %strips = ( + 1 => [ + [ [ 1750, 150, ], [ 1850, 150, ], ], + [ [ 1950, 150, ], [ 2050, 150, ], ], + ] + ); #3........... }, - 'atlc.atlc2' => { - source => "atlc", - params => "atlc2", + 'git146.git146' => { + source => "git146", + params => "git146", expect => <<'#4...........', -$self->make_grammar( - { - iterator => $self->_iterator, - parser => $self, - version => $self->version, - }, -); + my %strips = ( + 1 => [ + [ [ 1750, 150, ], [ 1850, 150, ], ], + [ [ 1950, 150, ], [ 2050, 150, ], ], + ], + ); #4........... }, - 'atlc.def' => { - source => "atlc", - params => "def", + 'altc.altc1' => { + source => "altc", + params => "altc1", expect => <<'#5...........', $self->make_grammar( { iterator => $self->_iterator, parser => $self, - version => $self->version + version => $self->version, } ); #5........... }, - 'dtlc.def' => { - source => "dtlc", - params => "def", + 'altc.altc2' => { + source => "altc", + params => "altc2", expect => <<'#6...........', $self->make_grammar( { @@ -176,9 +174,9 @@ $self->make_grammar( #6........... }, - 'dtlc.dtlc1' => { - source => "dtlc", - params => "dtlc1", + 'altc.def' => { + source => "altc", + params => "def", expect => <<'#7...........', $self->make_grammar( { @@ -190,43 +188,45 @@ $self->make_grammar( #7........... }, - 'dtlc.dtlc2' => { - source => "dtlc", - params => "dtlc2", + 'dltc.def' => { + source => "dltc", + params => "def", expect => <<'#8...........', $self->make_grammar( { iterator => $self->_iterator, parser => $self, - version => $self->version + version => $self->version, }, ); #8........... }, - 'git146.def' => { - source => "git146", - params => "def", + 'dltc.dltc1' => { + source => "dltc", + params => "dltc1", expect => <<'#9...........', - my %strips = ( - 1 => [ - [ [ 1750, 150, ], [ 1850, 150, ], ], - [ [ 1950, 150, ], [ 2050, 150, ], ], - ] - ); +$self->make_grammar( + { + iterator => $self->_iterator, + parser => $self, + version => $self->version + } +); #9........... }, - 'git146.git146' => { - source => "git146", - params => "git146", + 'dltc.dltc2' => { + source => "dltc", + params => "dltc2", expect => <<'#10...........', - my %strips = ( - 1 => [ - [ [ 1750, 150, ], [ 1850, 150, ], ], - [ [ 1950, 150, ], [ 2050, 150, ], ], - ], - ); +$self->make_grammar( + { + iterator => $self->_iterator, + parser => $self, + version => $self->version + }, +); #10........... }, }; -- 2.39.5