1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
use strict;
use warnings;
use Test::More 0.88;
use Test::Warnings qw( warnings );
## no critic (Modules::ProhibitMultiplePackages)
{
package Foo;
our $VERSION = '0.03';
use Exporter qw( import );
our @EXPORT_OK = qw( exported );
use Package::DeprecationManager -deprecations => {
'Foo::foo' => '0.02',
};
sub foo {
deprecated();
}
sub exported {
return 'exported';
}
}
{
package Bar;
Foo->import( 'exported', -api_version => '0.01' );
::is_deeply(
[ ::warnings { Foo::foo() } ],
[],
'no warning for foo with api_version = 0.01'
);
::is(
exported(),
'exported',
'sub exported by Foo was imported and work as expected'
);
}
done_testing();
|