This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/porting/readme.t: Get list from MANIFEST
authorFather Chrysostomos <sprout@cpan.org>
Thu, 28 Aug 2014 17:52:22 +0000 (10:52 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 28 Aug 2014 17:52:22 +0000 (10:52 -0700)
Otherwise we end up failing because of editor or patch droppings
in Porting/.  The test was already skipping things ending with ~
but that was not sufficient.

t/porting/readme.t

index cbb2fe8..85d044e 100644 (file)
@@ -12,13 +12,18 @@ use strict;
 use warnings;
 require 't/test.pl';
 
-open(my $fh, '<', 'Porting/README.pod') or die("Can't open Porting/README.pod: $!");
-
-my @porting_files = grep { !/~\z/ } glob("Porting/*");
+my @porting_files;
+open my $man, "MANIFEST" or die "Can't open MANIFEST: $!";
+while(<$man>) {
+    /^Porting\// and s/[\t\n].*//s, push @porting_files, $_;
+}
+close $man or die "Can't close MANIFEST: $!";
 # It seems that dying here is nicer than having several dozen failing tests
 # later.  But that assumes one will see the message from die.
 die "Can't get contents of Porting/ directory.\n" unless @porting_files > 1;
 
+open(my $fh, '<', 'Porting/README.pod') or die("Can't open Porting/README.pod: $!");
+
 my (@current_order, @sorted_order, %files_in_pod);
 while(<$fh>) {
     next unless $_ =~ /^=head/;
@@ -31,7 +36,6 @@ while(<$fh>) {
 
 for my $file (@porting_files) {
     $file =~ s!^Porting/!!;
-    $file =~ s/\.\z// if $^O eq 'VMS';
     next if $file =~ /^perl[0-9]+delta\.pod$/;
     ok(exists($files_in_pod{$file}), "$file is mentioned in Porting/README.pod");
     delete $files_in_pod{$file};