| 1 |
#!perl -T |
| 2 |
use strict; |
| 3 |
use warnings; |
| 4 |
|
| 5 |
use lib 't/lib'; |
| 6 |
use T::RequireDateTime; |
| 7 |
|
| 8 |
use Test::Requires { |
| 9 |
'Test::Taint' => 0, |
| 10 |
}; |
| 11 |
|
| 12 |
use Test::Fatal qw( lives_ok ); |
| 13 |
use Test::More; |
| 14 |
|
| 15 |
use DateTime::TimeZone; |
| 16 |
use DateTime::TimeZone::Local; |
| 17 |
|
| 18 |
if ( taint_checking_ok('taint mode is on') ) { |
| 19 |
my $name = 'America/Chicago'; |
| 20 |
taint($name); |
| 21 |
|
| 22 |
lives_ok( |
| 23 |
sub { DateTime::TimeZone->new( name => $name ) }, |
| 24 |
'DateTime::TimeZone untaints tz name before loading tz module' |
| 25 |
); |
| 26 |
} |
| 27 |
|
| 28 |
done_testing(); |
| 29 |
|