podcheck.t: Missing diagnostics
authorKarl Williamson <public@khwilliamson.com>
Thu, 19 May 2011 22:29:11 +0000 (16:29 -0600)
committerKarl Williamson <public@khwilliamson.com>
Thu, 19 May 2011 22:54:47 +0000 (16:54 -0600)
podcheck.t was not outputting a message when all occurrences of
an issue were removed, and hence the database wasn't getting
regenerated

t/porting/podcheck.t

index 92a9ec7..999bcb1 100644 (file)
@@ -1362,10 +1362,6 @@ foreach my $filename (@files) {
         my @diagnostics;
         my $indent = '  ';
 
-        if ( ! $problems{$filename} && $known_problems{$filename}) {
-            push @diagnostics, output_thanks($filename,
-                            scalar keys %{$known_problems{$filename}}, 0, undef);
-        }
         my $total_known = 0;
         foreach my $message ( sort keys %{$problems{$filename}}) {
             $known_problems{$filename}{$message} = 0
@@ -1399,6 +1395,16 @@ foreach my $filename (@files) {
             push @diagnostics, $diagnostic if $diagnostic;
         }
 
+        # The above loop has output messages where there are current potential
+        # issues.  But it misses where there were some that have been entirely
+        # fixed.  For those, we need to look through the old issues
+        foreach my $message ( sort keys %{$known_problems{$filename}}) {
+            next if $problems{$filename}{$message};
+            next if ! $known_problems{$filename}{$message};
+            my $diagnostic = output_thanks($filename, $known_problems{$filename}{$message}, 0, $message);
+            push @diagnostics, $diagnostic if $diagnostic;
+        }
+
         my $output = "POD of $filename";
         $output .= ", excluding $total_known not shown known potential problems"
                                                                 if $total_known;