Subject: | Quiet warning in Manifest.t |
Manifest.t removed the $warn initialization in catch_warning() causing a
use of uninitialized value warning in one of the tests. I've put that
initialization back.
I've also changed a "cmp_ok( $foo, 'eq', $bar )" to the simpler "is(
$foo, $bar )" and some minor whitespace nits.
Subject: | Manifest.patch |
=== t/Manifest.t
==================================================================
--- t/Manifest.t (revision 19602)
+++ t/Manifest.t (local)
@@ -46,7 +46,7 @@
}
sub catch_warning {
- my $warn;
+ my $warn = '';
local $SIG{__WARN__} = sub { $warn .= $_[0] };
return join('', $_[0]->() ), $warn;
}
@@ -72,7 +72,7 @@
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);
@@ -97,10 +97,10 @@
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 )
};
-cmp_ok( $warn, 'eq', '', 'disabled warnings' );
+is( $warn, '', 'disabled warnings' );
# add a skip file with a rule to skip itself (and the nonexistent glob '*baz*')
add_file( 'MANIFEST.SKIP', "baz\n.SKIP" );
@@ -164,7 +164,7 @@
ok( mkdir( 'copy', 0777 ), 'made copy directory' );
$files = maniread();
eval { (undef, $warn) = catch_warning( sub {
- manicopy( $files, 'copy', 'cp' ) })
+ manicopy( $files, 'copy', 'cp' ) })
};
like( $@, qr/^Can't read none: /, 'croaked about none' );
@@ -179,7 +179,7 @@
local $ExtUtils::Manifest::MANIFEST = 'albatross';
($res, $warn) = catch_warning( \&mkmanifest );
like( $warn, qr/Added to albatross: /, 'using a new manifest file' );
-
+
# add the new file to the list of files to be deleted
$Files{'albatross'}++;
}
@@ -200,7 +200,7 @@
add_file( 'foobar' => '123' );
($res, $warn) = catch_warning( \&manicheck );
is( $res, '', 'MANIFEST overrides MANIFEST.SKIP' );
-is( $warn, undef, 'MANIFEST overrides MANIFEST.SKIP, no warnings' );
+is( $warn, '', 'MANIFEST overrides MANIFEST.SKIP, no warnings' );
$files = maniread;
ok( !$files->{wibble}, 'MANIFEST in good state' );