Branch Coverage

blib/lib/Time/Zone/Olsen.pm
Criterion Covered Total %
branch 165 224 73.6


line true false branch
106 2 5920 if (@_ > 1)
115 0 28 unless my $handle = 'FileHandle'->new($path)
118 0 28 if ($$self{'_timezone_cache'} and $$self{'_timezone_cache'} == $_last_modified) { }
126 1008 11648 if $line =~ /^[#]/msx
133 0 28 unless close $handle
145 1664 0 if ($timezone =~ /^$timezone_full_name_regex$/msx) { }
159 0 22 unless (length $area)
165 9152 0 if ($timezone =~ /^$timezone_full_name_regex$/msx) { }
166 856 8296 if ($area eq $Time::Zone::Olsen::LAST_PAREN_MATCH{'area'} and $Time::Zone::Olsen::LAST_PAREN_MATCH{'location'})
185 2 0 if (defined $$self{'_comments'}{$tz}) { }
196 419 11730 if (@_ > 1)
197 419 0 if (defined $new)
199 0 419 unless ($new =~ /^$timezone_full_name_regex$/msx)
204 0 419 unless (-f $path)
217 25427 78510 if ($year % _EVERY_FOUR_HUNDRED_YEARS() == 0 or $year % _EVERY_FOUR_YEARS() == 0 and $year % _EVERY_ONE_HUNDRED_YEARS() != 0) { }
234 6 0 if (defined $$tz_definition{'start_day'} and defined $$tz_definition{'end_day'} and defined $$tz_definition{'start_week'} and defined $$tz_definition{'end_week'} and defined $$tz_definition{'start_month'} and defined $$tz_definition{'end_month'})
265 0 6 if ($dst_start_time < $dst_end_time) { }
266 0 0 if ($dst_start_time < $check_time and $check_time < $dst_end_time)
273 6 0 if ($check_time < $dst_start_time or $dst_end_time < $check_time)
293 204 600 if ($self->_is_leap_year($check_year)) { }
314 0 12 if ($week == _TZ_ENVIRONMENT_LAST_WEEK_VALUE()) { }
324 0 0 if ($check_day_of_week < 0)
355 786 0 if (defined $$tz_definition{'std_name'})
356 6 780 if (defined $$tz_definition{'dst_name'}) { }
357 6 0 if ($self->_in_dst_according_to_tz($time, $tz_definition)) { }
388 2016 54 if ($check_time - $increment > $time) { }
406 440 54 if ($check_time - $increment > $time) { }
421 750 54 if ($check_time - $increment > $time) { }
437 1126 54 if ($check_time - $increment > $time) { }
448 2158 54 if ($check_time - $increment > $time) { }
472 66021 1649 if ($check_time + $increment <= $time) { }
490 5537 1649 if ($check_time + $increment <= $time) { }
503 31598 1649 if ($check_time + $increment <= $time) { }
519 9456 1649 if ($check_time + $increment <= $time) { }
530 54808 1649 if ($check_time + $increment <= $time) { }
546 54 1649 if ($time < 0) { }
552 861 842 if (wantarray) { }
564 815 27 if ($localtime[_LOCALTIME_YEAR_INDEX()] >= _EPOCH_YEAR()) { }
580 32385 815 if ($check_year < $localtime[_LOCALTIME_YEAR_INDEX()]) { }
595 2705 815 if ($check_month < $localtime[_LOCALTIME_MONTH_INDEX()]) { }
605 15779 815 if ($check_day < $localtime[_LOCALTIME_DAY_INDEX()]) { }
618 4684 815 if ($check_hour < $localtime[_LOCALTIME_HOUR_INDEX()]) { }
628 27380 815 if ($check_minute < $localtime[_LOCALTIME_MINUTE_INDEX()]) { }
647 315 2242 $leap_year ? :
668 25124 78063 if ($leap_year) { }
684 1008 27 if ($check_year > $localtime[_LOCALTIME_YEAR_INDEX()]) { }
699 220 27 if ($check_month > $localtime[_LOCALTIME_MONTH_INDEX()]) { }
709 375 27 if ($check_day > $localtime[_LOCALTIME_DAY_INDEX()]) { }
722 563 27 if ($check_hour > $localtime[_LOCALTIME_HOUR_INDEX()]) { }
732 1106 27 if ($check_minute > $localtime[_LOCALTIME_MINUTE_INDEX()]) { }
758 842 49998 unless (defined $first_transition_time)
767 580 50260 if ($transition_time > $time)
774 1 841 if (defined $first_transition_time and $$self{'_tzdata'}{$tz}{'local_time_types'}[0] and $time < $first_transition_time + $$self{'_tzdata'}{$tz}{'local_time_types'}[0]{'gmtoff'}) { }
262 579 elsif (not $transition_time_found) { }
791 262 0 if (defined $gmtoff)
795 263 579 if ($offset_found) { }
579 0 elsif (defined $$self{'_tzdata'}{$tz}{'local_time_indexes'}[$transition_index - 1]) { }
0 0 elsif (my $local_time_type = $$self{'_tzdata'}{$tz}{'local_time_types'}[0]) { }
830 1685 99952 unless (defined $first_transition_time)
834 1161 100476 if ($transition_time > $time)
841 2 1683 if (defined $first_transition_time and $time < $first_transition_time) { }
524 1159 elsif (not $transition_time_found) { }
854 524 0 if (defined $gmtoff)
858 526 1159 if ($offset_found) { }
1159 0 elsif (defined $$self{'_tzdata'}{$tz}{'local_time_indexes'}[$transition_index - 1]) { }
0 0 elsif (my $local_time_type = $$self{'_tzdata'}{$tz}{'local_time_types'}[0]) { }
885 0 1685 unless (defined $time)
892 843 842 if (wantarray) { }
895 0 843 if (_BSD_LOCALTIME_EXTENSION())
925 840 0 if (defined $result) { }
926 0 840 if ($result != _SIZE_OF_TZ_HEADER())
938 0 840 unless $magic eq 'TZif'
957 840 0 if (defined $result) { }
958 0 840 if ($result != $sizeof_transition_times)
969 420 420 if ($sizeof_transition_time == _SIZE_OF_TRANSITION_TIME_V1()) { }
420 0 elsif ($sizeof_transition_time == _SIZE_OF_TRANSITION_TIME_V2()) { }
973 0 420 unless (eval { do { @transition_times = unpack('q>' . $timecnt, $buffer) } })
986 840 0 if (defined $result) { }
987 0 840 if ($result != $timecnt)
1005 840 0 if (defined $result) { }
1006 0 840 if ($result != $sizeof_local_time_types)
1031 840 0 if (defined $result) { }
1032 0 840 if ($result != $charcnt)
1050 840 0 if (defined $result) { }
1051 0 840 if ($result != $sizeof_leap_seconds)
1074 840 0 if (defined $result) { }
1075 0 840 if ($result != $ttisstdcnt)
1093 840 0 if (defined $result) { }
1094 0 840 if ($result != $ttisgmtcnt)
1112 420 0 if (defined $result) { }
1113 0 420 if ($result == _MAX_LENGTH_FOR_TRAILING_TZ_DEFINITION())
1124 419 1 if ($buffer =~ /^\n([^\n]+)\n*$/msx)
1186 419 0 if ($tz_variable =~ /^$std_name_regex$std_offset_regex(?:$dst_name_regex(?:$dst_offset_regex)?,$start_datetime_regex,$end_datetime_regex)?$/msx) { }
1195 2327 8567 if (defined $Time::Zone::Olsen::LAST_PAREN_MATCH{$key})
1215 0 419 if (defined $$tz_definition{'dst_minutes'})
1219 2 417 if (defined $$tz_definition{'dst_hours'})
1225 2 417 if (defined $$tz_definition{'dst_sign'} and $$tz_definition{'dst_sign'} eq '-') { }
1232 417 2 if ($dst_offset_in_seconds == 0)
1243 16 403 if (defined $$tz_definition{'std_minutes'})
1247 419 0 if (defined $$tz_definition{'std_hours'})
1253 227 192 if (defined $$tz_definition{'std_sign'} and $$tz_definition{'std_sign'} eq '-') { }
1265 45 374 defined $$tz_definition{'start_hour'} ? :
1269 1 418 defined $$tz_definition{'start_minute'} ? :
1273 0 419 defined $$tz_definition{'start_second'} ? :
1277 82 337 defined $$tz_definition{'end_hour'} ? :
1281 1 418 defined $$tz_definition{'end_minute'} ? :
1285 0 419 defined $$tz_definition{'end_second'} ? :
1298 3777 840 if ($$self{'_tzdata'}{$tz}{'local_time_types'}[$index + 1]) { }
1341 420 0 if ($$header{'version'} >= 2 and defined $Time::Zone::Olsen::Config{'d_quad'} and $Time::Zone::Olsen::Config{'d_quad'} eq 'define')
1376 0 5471 unless my $handle = 'FileHandle'->new($path)
1379 5051 420 if ($$self{'_tzdata'}{$tz}{'mtime'} and $$self{'_tzdata'}{$tz}{'mtime'} == $_last_modified) { }
1390 0 5471 unless close $handle