Merge pull request #317 from bduggan/master

prevent error for invalid output timezone
master
Rob Emery 2014-02-09 17:02:37 +00:00
commit 695bf979b9
3 changed files with 4 additions and 0 deletions

View File

@ -151,6 +151,7 @@ handle query => sub {
return unless defined $gmt_input_timezone;
my $gmt_output_timezone = parse_timezone $output_timezone;
return unless defined($gmt_output_timezone);
$modifier += $gmt_output_timezone - $gmt_input_timezone;
for ( $gmt_input_timezone, $gmt_output_timezone ) {

View File

@ -13,6 +13,7 @@ ddg_goodie_test(
DDG::Goodie::Binary
)],
'this in binary' => test_zci('"this" as a string is "01110100011010000110100101110011" in binary.'),
'12 in binary' => test_zci('"12" as decimal is "00001100" in binary.'),
'that to binary' => test_zci('"that" as a string is "01110100011010000110000101110100" in binary.'),
'127 to binary' => test_zci('"127" as decimal is "01111111" in binary.'),
'256 to binary' => test_zci('"256" as decimal is "0000000100000000" in binary.'),

View File

@ -37,6 +37,8 @@ ddg_goodie_test(
test_zci('19:42:42 (BIT, UTC-12) is 11:42:42, 5 days after (GMT+100).'),
'19:42:42 CHADT into GMT-100' =>
test_zci('19:42:42 (CHADT, UTC+13:45) is 1:57:42, 4 days prior (GMT-100).'),
'12 in binary' =>
undef,
);
done_testing;