bring MM_VMS::perldepend into 21st century
[p5sagit/p5-mst-13.2.git] / lib / ExtUtils / Manifest.t
index a1452b9..f531406 100644 (file)
@@ -19,7 +19,7 @@ my @files;
 sub add_file {
        my ($file, $data) = @_;
        $data ||= 'foo';
-       open( my $T, ">$file") or return;
+       open( my $T, '>', $file) or return;
        print $T $data;
        push @files, $file;
 }
@@ -55,10 +55,10 @@ ok( add_file('foo'), 'add a temporary file' );
 
 # there shouldn't be a MANIFEST there
 my ($res, $warn) = catch_warning( \&mkmanifest ); 
-is( $warn, <<ADDING, "mkmanifest() displayed it's additions" );
-Added to MANIFEST: MANIFEST
-Added to MANIFEST: foo
-ADDING
+# Canonize the order.
+$warn = join("", map { "$_|" } sort { lc $a cmp lc $b } split /\r?\n/, $warn);
+is( $warn, "Added to MANIFEST: foo|Added to MANIFEST: MANIFEST|",
+    "mkmanifest() displayed it's additions" );
 
 # and now you see it
 ok( -e 'MANIFEST', 'create MANIFEST file' );
@@ -105,13 +105,15 @@ is( join(' ', filecheck() ), 'bar', 'listing skipped with filecheck()' );
 # add a subdirectory and a file there that should be found
 ok( mkdir( 'moretest', 0777 ), 'created moretest directory' );
 my $quux = File::Spec->catfile( 'moretest', 'quux' );
+$quux =~ s#\\#/#g;
+$quux = VMS::Filespec::unixify($quux) if $^O eq 'VMS';
 add_file( $quux, 'quux' );
 ok( exists( ExtUtils::Manifest::manifind()->{$quux} ), "manifind found $quux" );
 
 # only MANIFEST and foo are in the manifest
 my $files = maniread();
 is( keys %$files, 2, 'two files found' );
-is( join(' ', sort keys %$files), 'MANIFEST foo', 'both files found' );
+is( join(' ', sort { lc($a) cmp lc($b) } keys %$files), 'foo MANIFEST', 'both files found' );
 
 # poison the manifest, and add a comment that should be reported
 add_file( 'MANIFEST', 'none #none' );
@@ -129,7 +131,7 @@ chomp($warn);
 
 # the copy should have given one warning and one error
 is($warn, 'Skipping MANIFEST.SKIP', 'warned about MANIFEST.SKIP' );
-like( $@, qr/^Can't read none: No such file or directory/, 
+like( $@, qr/^Can't read none: /, 
                                                'carped about none' );
 
 # tell ExtUtils::Manifest to use a different file
@@ -149,5 +151,7 @@ END {
 
        # now get rid of the parent directory
        ok( chdir( $cwd ), 'return to parent directory' );
+       unlink('mantest/MANIFEST');
        remove_dir( 'mantest' );
 }
+