Skip to content

Commit

Permalink
clean up deprecation tests, be explicit about deprecation warnings bo…
Browse files Browse the repository at this point in the history
…th being found and not being found
  • Loading branch information
DrHyde committed Nov 9, 2022
1 parent 1d790a3 commit b5fae0a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile.PL
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ WriteMakefile(
'Carp' => 0,
'Test::Differences' => 0.62,
'Test::More' => '0.96', # need done_testing (0.88) and subtests (0.95_01)
'Test::Warnings' => 0,
'Test::Warnings' => 0.031,
'Devel::Hide' => 0,
'if' => 0,
},
Expand Down
17 changes: 14 additions & 3 deletions t/deprecations.t
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,32 @@ use warnings;

use Data::Dumper::Concise;
use Test::More;
use Test::Warnings qw(warning);
use Test::Warnings qw(warning :no_end_test);

my $warnings = [ warning { use_ok 'Number::Phone' } ];

if(~0 == 4294967295) {
ok(
scalar(grep { /32 bit/ } @{$warnings}),
scalar(grep { /32 bit/ } @{$warnings}) == 1,
"warned about 32 bit support going away"
)
} else {
ok(
scalar(grep { /32 bit/ } @{$warnings}) == 0,
"no warnings about 32 bit support going away"
)
}

if($] < 5.010) {
ok(
scalar(grep { /too old/ } @{$warnings}),
scalar(grep { /too old/ } @{$warnings}) == 1,
"warned about perl being too old"
)
} else {
ok(
scalar(grep { /too old/ } @{$warnings}) == 0,
"no warnings about perl being too old"
)
}

done_testing();

0 comments on commit b5fae0a

Please sign in to comment.