mirror of
https://github.com/percona/percona-toolkit.git
synced 2025-09-12 06:00:14 +00:00
51 lines
1.0 KiB
Perl
51 lines
1.0 KiB
Perl
#!/usr/bin/perl
|
|
|
|
BEGIN {
|
|
die "The PERCONA_TOOLKIT_BRANCH environment variable is not set.\n"
|
|
unless $ENV{PERCONA_TOOLKIT_BRANCH} && -d $ENV{PERCONA_TOOLKIT_BRANCH};
|
|
unshift @INC, "$ENV{PERCONA_TOOLKIT_BRANCH}/lib";
|
|
};
|
|
|
|
use strict;
|
|
use warnings FATAL => 'all';
|
|
use English qw(-no_match_vars);
|
|
use Test::More;
|
|
|
|
use PerconaTest;
|
|
use Percona::Toolkit;
|
|
use Percona::WebAPI::Resource::Config;
|
|
use Percona::WebAPI::Util qw(resource_diff);
|
|
|
|
my $x = Percona::WebAPI::Resource::Config->new(
|
|
options => {
|
|
'lib' => '/var/lib',
|
|
'spool' => '/var/spool',
|
|
},
|
|
);
|
|
|
|
my $y = Percona::WebAPI::Resource::Config->new(
|
|
options => {
|
|
'lib' => '/var/lib',
|
|
'spool' => '/var/spool',
|
|
},
|
|
);
|
|
|
|
is(
|
|
resource_diff($x, $y),
|
|
0,
|
|
"No diff"
|
|
);
|
|
|
|
$y->options->{spool} = '/var/lib/spool';
|
|
|
|
is(
|
|
resource_diff($x, $y),
|
|
1,
|
|
"Diff"
|
|
);
|
|
|
|
# #############################################################################
|
|
# Done.
|
|
# #############################################################################
|
|
done_testing;
|