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;
}
# 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' );
# 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' );
# 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
# now get rid of the parent directory
ok( chdir( $cwd ), 'return to parent directory' );
+ unlink('mantest/MANIFEST');
remove_dir( 'mantest' );
}
+