develooper Front page | perl.vmsperl | Postings from May 2002

[PATCH @16611] lib/ExtUtils/t/Constant.t on VMS

From:
Craig A. Berry
Date:
May 16, 2002 12:13
Subject:
[PATCH @16611] lib/ExtUtils/t/Constant.t on VMS
Message ID:
5.1.0.14.2.20020516140747.03562438@exchi01
readdir() returns lower-cased filenames, and if there is no extension a 
trailing dot is present.  This makes the test expect what it will get.

--- lib/ExtUtils/t/Constant.t;-0        Mon May 13 19:07:15 2002
+++ lib/ExtUtils/t/Constant.t   Thu May 16 13:47:14 2002
@@ -648,11 +648,12 @@
 
 sub check_for_bonus_files {
   my $dir = shift;
-  my %expect = map {$_, 1} @_;
+  my %expect = map {($^O eq 'VMS' ? lc($_) : $_), 1} @_;
 
   my $fail;
   opendir DIR, $dir or die "opendir '$dir': $!";
   while (defined (my $entry = readdir DIR)) {
+    $entry =~ s/\.$// if $^O eq 'VMS';  # delete trailing dot that indicates no extension
     next if $expect{$entry};
     print "# Extra file '$entry'\n";
     $fail = 1;
[end of patch]




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About