]> git.donarmstrong.com Git - perltidy.git/commitdiff
fix b1444
authorSteve Hancock <perltidy@users.sourceforge.net>
Fri, 20 Jan 2023 15:17:08 +0000 (07:17 -0800)
committerSteve Hancock <perltidy@users.sourceforge.net>
Fri, 20 Jan 2023 15:17:08 +0000 (07:17 -0800)
dev-bin/run_convergence_tests.pl
dev-bin/run_convergence_tests.pl.data
dev-bin/run_convergence_tests.pl.expect
lib/Perl/Tidy/Formatter.pm

index d26c25e486783423f9975063a694d0250af42089..5562161a94110a43e62439cdc6dbc249344012ce 100755 (executable)
@@ -400,7 +400,7 @@ sub run_test_cases {
                     }
                 }
                 else {
-                    $msg = "NEW EXPECT";
+                    $msg = "..NEW";
                     push @expect_cases_to_update, $sname;
                     $rexpect_files->{$sname} = $output;
                 }
@@ -453,9 +453,9 @@ SKIPPED: these requested cases were not found in the database:
 EOM
     }
     if (@expect_cases_to_update) {
+        my $new_expect = @expect_cases_to_update;
         print <<EOM;
-NEW: the .expect data will be updated with output for these cases
-@expect_cases_to_update
+NEW: added $new_expect cases to .expect: @expect_cases_to_update
 EOM
     }
     if (@expect_differences) {
index 089f297e522f6e2881b4d13fccda4c7827a7ff63..339a21f95ba4594cbd12865b284644c29fd77ba7 100644 (file)
@@ -11283,6 +11283,33 @@ $last = after (
 --ignore-old-breakpoints
 --want-trailing-commas='i'
 
+==> b1444.in <==
+                  while ( my ( $k, $v )
+                           = each %{ $self->{channels}->{$chk}->{device_cache}
+                           } )
+                  {
+                           ...;
+                  }
+
+                  while (  my ( $k, $v )
+                           = each %{$self->{channels}->{$chk}->{device_cache} }
+                         )
+                  {
+                           ...;
+                  }
+
+
+==> b1444.par <==
+--brace-vertical-tightness-closing=1
+--break-before-all-operators
+--continuation-indentation=7
+--extended-continuation-indentation
+--extended-line-up-parentheses
+--indent-columns=9
+--maximum-line-length=79
+--space-keyword-paren
+--vertical-tightness=1
+
 ==> b146.in <==
 # State 1
 
index 4b510ec783909e5d8d8a31c92ed533cfc6fcd066..d23bffa0050b5a17b38e6a8aca7e381563653bd8 100644 (file)
@@ -7653,6 +7653,26 @@ $last = after (
         } _search_ISA($pkg);
 
 
+==> b1444 <==
+                  while (  my ( $k, $v )
+                           = each %{
+                                    $self->{channels}->{$chk}->{device_cache}
+                           }
+                         )
+                  {
+                           ...;
+                  }
+
+                  while (  my ( $k, $v )
+                           = each %{
+                                    $self->{channels}->{$chk}->{device_cache}
+                           }
+                         )
+                  {
+                           ...;
+                  }
+
+
 ==> b146 <==
 # State 1
 
index efca6d136462375a3754c021f45a863777f1fe52..236d88f00e0ece61e124a36ed9a4a6f393944f89 100644 (file)
@@ -22348,9 +22348,26 @@ EOM
             if ( $minimum_depth <= $current_depth ) {
 
                 if ( $i_opening >= 0 ) {
-                    $self->set_forced_breakpoint($i_opening)
-                      unless ( $do_not_break_apart
-                        || is_unbreakable_container($current_depth) );
+                    if (   !$do_not_break_apart
+                        && !is_unbreakable_container($current_depth) )
+                    {
+                        $self->set_forced_breakpoint($i_opening);
+
+                        # Do not let brace types L/R use vertical tightness
+                        # flags to recombine if we have to break on length
+                        # because instability is possible if both vt and vtc
+                        # flags are set ... see issue b1444.
+                        if (   $is_long_term
+                            && $types_to_go[$i_opening] eq 'L'
+                            && $opening_vertical_tightness{'{'}
+                            && $closing_vertical_tightness{'}'} )
+                        {
+                            my $seqno = $type_sequence_to_go[$i_opening];
+                            if ($seqno) {
+                                $self->[_rbreak_container_]->{$seqno} = 1;
+                            }
+                        }
+                    }
                 }
 
                 # break at ',' of lower depth level before opening token