This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Add to known_pod_issues.dat following Test-Harness upgrade
[perl5.git] / t / porting / checkcase.t
index edaeb60..3c05e22 100644 (file)
@@ -3,6 +3,7 @@
 
 BEGIN {
     @INC = '..' if -f '../TestInit.pm';
+    require './test.pl';
 }
 use TestInit qw(T); # T is chdir to the top level
 
@@ -13,7 +14,7 @@ use File::Find;
 my %files;
 my $test_count = 0;
 
-find(sub {
+find({no_chdir => 1, wanted => sub {
           my $name = $File::Find::name;
           # Assumes that the path separator is exactly one character.
           $name =~ s/^\..//;
@@ -21,16 +22,23 @@ find(sub {
           # Special exemption for Makefile, makefile
           return if $name =~ m!\A(?:x2p/)?[Mm]akefile\z!;
 
+          if ($name eq '.git') {
+              # Don't scan the .git directory, as its contents are outside
+              # our control. In particular, as fetch doesn't default to
+              # --prune, # someone pushing a branch upstream with a name
+              # which case-conflicts with a previously deleted branch will
+              # cause action-at-a-distance failures, because locally
+              # .git/logs/refs/remotes will contain both.
+              ++$File::Find::prune;
+              return;
+          }
+
           push @{$files{lc $name}}, $name;
-        }, '.');
+        }}, '.');
 
 foreach (sort values %files) {
-    if (@$_ > 1) {
-               print "not ok ".++$test_count. " - ". join(", ", @$_), "\n";
-               print STDERR "# $_\n" foreach @$_;
-    } else {
-               print "ok ".++$test_count. " - ". join(", ", @$_), "\n";
-       }
+    is( @$_, 1, join(", ", @$_) ) or
+        do{ note($_) foreach @$_; };
 }
 
-print "1..".$test_count."\n";
+done_testing();