Merge pull request #98 from jaredj/silence-test-warning
Replace warning with slightly better testing
This commit is contained in:
commit
7676a213cf
10
t/qpsmtpd.t
10
t/qpsmtpd.t
@ -22,7 +22,17 @@ __load_logging();
|
||||
done_testing();
|
||||
|
||||
sub __log {
|
||||
my $warned = '';
|
||||
local $SIG{__WARN__} = sub {
|
||||
if ( $_[0] eq "$$ test log message\n" ) {
|
||||
$warned = join ' ', @_;
|
||||
}
|
||||
else {
|
||||
warn @_;
|
||||
}
|
||||
};
|
||||
ok( $qp->log(LOGWARN, "test log message"), 'log');
|
||||
is( $warned, "$$ test log message\n", 'LOGWARN emitted correct warning' );
|
||||
}
|
||||
|
||||
sub __config_dir {
|
||||
|
Loading…
Reference in New Issue
Block a user