1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-06-14 23:44:58 +02:00

Rename Perl tests so they don't conflict with their C counterparts.

This commit is contained in:
David Steele
2018-01-16 12:36:22 -05:00
parent 0e9ba98a50
commit d992851456
5 changed files with 10 additions and 6 deletions

View File

@ -0,0 +1,46 @@
####################################################################################################################################
# CommonLogTest.pm - Unit tests for Log module
####################################################################################################################################
package pgBackRestTest::Module::Common::CommonLogPerlTest;
use parent 'pgBackRestTest::Common::RunTest';
####################################################################################################################################
# Perl includes
####################################################################################################################################
use strict;
use warnings FATAL => qw(all);
use Carp qw(confess);
use English '-no_match_vars';
use pgBackRest::Common::Exception;
use pgBackRest::Common::Ini;
use pgBackRest::Common::Log;
use pgBackRest::Version;
use pgBackRestTest::Common::ExecuteTest;
use pgBackRestTest::Common::RunTest;
####################################################################################################################################
# run
####################################################################################################################################
sub run
{
my $self = shift;
################################################################################################################################
if ($self->begin("log()"))
{
logWarnOnErrorEnable();
$self->testResult(sub {&log(ERROR, "my test log", 27)}, "[object]", 'log error as warning',
{strLogExpect => "WARN: [027]: my test log"});
$self->testResult(sub {&log(INFO, "my test log")}, "my test log", 'log info as info',
{strLogLevel => INFO, strLogExpect => "INFO: my test log"});
logWarnOnErrorDisable();
$self->testResult(sub {&log(ERROR, "my test log", 27)}, "[object]", 'log error',
{strLogExpect => "ERROR: [027]: my test log"});
}
}
1;