Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Require Package::DeprecationManager - it plays nice with our exporting
- Loading branch information
Showing
3 changed files
with
52 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
use strict; | ||
use warnings; | ||
|
||
# We need this to be set to catch warning from inside other packages. | ||
BEGIN { | ||
$^W = 1; | ||
} | ||
|
||
use Test::More; | ||
use Test::Warnings qw( warnings ); | ||
|
||
use DateTime::Format::Strptime qw( strftime strptime ), | ||
-api_version => '1.55'; | ||
|
||
is_deeply( | ||
[ | ||
warnings { | ||
my $parser = DateTime::Format::Strptime->new( pattern => '%Y' ); | ||
$parser->pattern('%y'); | ||
$parser->locale('fr'); | ||
$parser->time_zone('UTC'); | ||
} | ||
], | ||
[], | ||
'no warnings when calling accessors on constructed object' | ||
); | ||
|
||
is( | ||
strptime( '%Y', '2005' )->year, | ||
2005, | ||
'export strptime works as expected' | ||
); | ||
|
||
is( | ||
strftime( '%Y', DateTime->new( year => 2005 ) ), | ||
2005, | ||
'export strftime works as expected' | ||
); | ||
|
||
done_testing(); |