}
sub catch_warning {
- my $warn = '';
+ my $warn;
local $SIG{__WARN__} = sub { $warn .= $_[0] };
return join('', $_[0]->() ), $warn;
}
ok( add_file('foo'), 'add a temporary file' );
# there shouldn't be a MANIFEST there
-my ($res, $warn) = catch_warning( \&mkmanifest );
+my ($res, $warn) = catch_warning( \&mkmanifest );
# Canonize the order.
$warn = join("", map { "$_|" }
sort { lc($a) cmp lc($b) } split /\r?\n/, $warn);
is( $res, 'bar', 'bar reported as new' );
# now quiet the warning that bar was added and test again
-($res, $warn) = do { local $ExtUtils::Manifest::Quiet = 1;
- catch_warning( \&skipcheck )
+($res, $warn) = do { local $ExtUtils::Manifest::Quiet = 1;
+ catch_warning( \&skipcheck )
};
-is( $warn, '', 'disabled warnings' );
+cmp_ok( $warn, 'eq', '', 'disabled warnings' );
# add a skip file with a rule to skip itself (and the nonexistent glob '*baz*')
add_file( 'MANIFEST.SKIP', "baz\n.SKIP" );
my @skipped;
catch_warning( sub {
- @skipped = skipcheck();
+ @skipped = skipcheck()
});
is( join( ' ', @skipped ), 'MANIFEST.SKIP', 'listed skipped files' );
foreach my $orig (@copies) {
my $copy = "copy/$orig";
ok( -r $copy, "$copy: must be readable" );
- is( -w $copy, -w $orig, " has orig write state" );
- is( -x $copy, -x $orig, " has orig executable state" );
+ is( -w $copy, -w $orig, " writable if original was" );
+ is( -x $copy, -x $orig, " executable if original was" );
}
rmtree('copy');
add_file( 'MANIFEST' => "foobar\n" );
add_file( 'foobar' => '123' );
($res, $warn) = catch_warning( \&manicheck );
-is( $res, '', 'MANIFEST overrides MANIFEST.SKIP' );
-is( $warn, '', 'MANIFEST overrides MANIFEST.SKIP, no warnings' );
+is( $res, '', 'MANIFEST overrides MANIFEST.SKIP' );
+is( $warn, undef, 'MANIFEST overrides MANIFEST.SKIP, no warnings' );
$files = maniread;
ok( !$files->{wibble}, 'MANIFEST in good state' );