Branch Coverage

blib/lib/DateTimeX/Lite.pm
Criterion Covered Total %
branch 129 142 90.8


line true false branch
6 0 56 $ENV{'DATETIMEX_LITE_LOCALE_SKIP'} ? :
46 0 32 if $@
82 0 0 if ($@)
94 621 5847 if $$self{'tz'} eq $tz
98 5784 63 ref $tz ? :
103 5598 249 if ($$self{'tz'}->is_floating xor $was_floating) { }
249 0 elsif (not $was_floating) { }
133 13335 180916 unless defined $p{$key}
135 166505 27746 if (my $range = $$spec{'range'})
137 20 166485 if (defined $$range[0] and $v < $$range[0] or defined $$range[1] and $v > $$range[1])
152 2 27735 if ($day > DateTimeX::Lite::Util::month_length($year, $month))
159 4343 23392 unless defined $locale
166 23378 4357 blessed $locale ? :
170 17066 10669 blessed $time_zone ? :
185 46 27684 if ($second > 59)
186 3 43 if ($$self{'tz'}->is_floating or $$self{'utc_rd_secs'} - 86400 + 1 < $second - 59)
199 37207 186 if ($time_zone->is_utc or $time_zone->is_floating) { }
221 14652 25178 if $$self{'tz'}->is_floating
228 255 24923 $utc_is_valid ? :
230 24857 321 if ($offset >= 0 and $$self{'local_rd_secs'} >= $offset) { }
38 325 elsif ($offset < 0 and $$self{'local_rd_secs'} >= 86400 + $offset) { }
234 52 24805 if ($second < 60 and $offset > 0) { }
39 24768 elsif ($second == 60 and $$self{'local_rd_secs'} == $offset && $offset > 0 || $offset == 0 && $$self{'local_rd_secs'} > 86399) { }
252 38 1 unless ($mod == 0)
263 31 7 if ($second < 60) { }
5 2 elsif ($second == 60 and $$self{'local_rd_secs'} == 86400 + $offset) { }
273 5 0 unless ($mod == 0)
291 27667 316 if ($$self{'tz'}->is_utc or $$self{'tz'}->is_floating) { }
338 6 727 if ($object->can('time_zone') and not $object->time_zone->is_floating and $rd_secs > 86399 and $rd_secs <= DateTimeX::Lite::LeapSecond::day_length($rd_days))
355 6319 3 if ($object->can('time_zone')) { }
370 2 72 if ($p{'month'} > 12 or $p{'month'} < 1)
393 4 11 $val - $int >= 0.5 ? :
398 10 10 $year <= 0 ? :
405 2 11 $_[0]{'local_c'}{'year'} <= 0 ? :
407 2 2 $_[0]->ce_year > 0 ? :
408 2 2 $_[0]->ce_year > 0 ? :
436 0 4 $d == 0 ? :
440 1 4 $_[0]{'local_c'}{'hour'} == 0 ? :
442 23 7 $h ? :
452 8 15 $_[0]->hour < 12 ? :
469 31 6 unless (defined $$self{'local_c'}{'week_year'})
477 18 13 if $jan_one_dow_m1 < 4
479 4 27 if ($$self{'local_c'}{'week_number'} == 0) { }
5 22 elsif ($$self{'local_c'}{'week_number'} == 53 and $self->_weeks_in_year($self->year) == 52) { }
510 4 7 $dow == 4 || $dow == 3 && DateTimeX::Lite::Util::is_leap_year($year) ? :
521 554 176 unless defined $sep
532 1 2 unless defined $sep
543 1 2 unless defined $sep
554 2 176 unless defined $sep
585 0 17073 if defined $self->formatter
625 2 26 if $fraction
637 6 22 if exists $p{'time_zone'}
646 16 0 unless exists $$self{'utc_c'}{'year'}
655 0 16 unless exists $$self{'utc_c'}{'hour'}
678 8 18 if ($p{'to'} eq 'week') { }
682 7 1 if ($day_diff)
693 70 56 $truncate ? :
695 18 108 if $p{'to'} eq $f
711 1 16 if exists $$self{'utc_c'}{'epoch'}
734 0 1 unless defined $epoch
752 1 2 if $$self{'tz'}->is_floating
761 0 16 unless defined $$self{'utc_rd_days'}
783 916 51 ref $_[0] ? :
785 0 967 unless defined $dt2
787 6 1 if (not ref $dt2 and $dt2 == 9**9**9 || $dt2 == -9**9**9)
792 2 959 unless (blessed $dt1 and $dt1->can('utc_rd_values') and (blessed $dt2 and $dt2->can('utc_rd_values')))
802 956 2 if (not $consistent and (blessed $dt1 and $dt1->can('time_zone')) and (blessed $dt2 and $dt2->can('time_zone')))
810 2 954 if ($is_floating1 and not $is_floating2) { }
3 1047 elsif ($is_floating2 and not $is_floating1) { }
825 902 201 if $dt1_components[$i] != $dt2_components[$i]
838 1 1121 if $p{'day_of_year'} == 366 and not $is_leap_year