Branch Coverage

blib/lib/DateTime/Format/Strptime.pm
Criterion Covered Total %
branch 154 174 88.5


line true false branch
30 1 2 if ($_[$i] eq '-api_version') { }
86 0 293 if ($self->{'debug'})
87 0 0 unless binmode STDERR, ":encoding(UTF-8)"
220 0 289 if ($self->{'debug'})
226 6 283 unless (@matches)
228 0 6 if ($self->{'debug'})
239 0 1109 unless (defined $matches[$i])
252 5 267 unless $constructor and $args
255 9 258 unless $dt
257 2 259 if ($post_construct)
260 25 192 unless $dt and $self->_check_dt($dt, \%args)
263 1 191 if $self->{'time_zone'}
291 0 294 if ($self->{'debug'} and $pattern ne $self->{'pattern'})
314 1139 839 if ($1) { }
6 833 elsif ($3) { }
1 832 elsif ($4) { }
315 0 1139 unless my $p = $patterns->{$1}
318 1128 11 if ($p->{'field'}) { }
327 2 4 $2 ? :
340 8 285 $self->{'strict'} ? :
466 0 6200 unless length $b <=> length $a
476 0 11825 unless length $b <=> length $a
487 0 0 unless length $b <=> length $a
506 44 294 if $self->{'locale_days'}
523 75 294 if $self->{'locale_months'}
540 0 0 unless length $b <=> length $a
571 75 208 if (defined $args->{'month_name'})
573 0 75 unless my $num = $self->_locale_months->{lc $args->{'month_name'}}
579 12 271 if (defined $args->{'am_pm'} and defined $args->{'hour_12'}) { }
3 268 elsif (defined $args->{'hour_12'}) { }
583 4 8 if (lc $args->{'am_pm'} eq lc $am) { }
584 0 4 if $args->{'hour'} == 12
587 8 0 unless $args->{'hour'} == 12
598 10 270 if (defined $args->{'year_100'})
599 1 9 if (defined $args->{'century'}) { }
605 4 5 $args->{'year_100'} >= 69 ? :
612 14 266 if ($args->{'time_zone_offset'})
615 1 13 if ($offset eq 'Z') { }
2 11 elsif ($offset =~ /^[+-][0-9]{2}$/) { }
623 3 11 unless ($tz)
633 18 259 if (defined $args->{'time_zone_abbreviation'}) { }
635 3 15 unless (exists $self->{'zone_map'}{$abbr})
641 4 11 unless (defined $self->{'zone_map'}{$abbr})
654 8 262 if ($args->{'time_zone_name'})
657 6 2 unless ($tz = &try(sub {
663 3 5 unless ($tz)
669 5 0 if $tz
681 6 261 if (defined $args->{'nanosecond'})
688 3 3 if length $args->{'nanosecond'} != 9
695 179 622 unless defined $args->{$k}
698 28 239 if (defined $args->{'epoch'}) { }
4 235 elsif ($args->{'day_of_year'}) { }
705 2 26 if (my $nano = $args->{'nanosecond'})
732 4 254 if (defined $args->{'hour'} and defined $args->{'hour_12'})
733 3 1 unless ($args->{'hour'} % 12 == $args->{'hour_12'})
741 27 228 if (defined $args->{'hour'} and defined $args->{'am_pm'})
742 6 21 if ($is_am and $args->{'hour'} >= 12 or not $is_am and $args->{'hour'} < 12)
751 4 245 if (defined $args->{'year'} and defined $args->{'century'})
752 3 1 unless (int $args->{'year'} / 100 == $args->{'century'})
760 4 242 if (defined $args->{'year'} and defined $args->{'year_100'})
761 3 1 unless ($args->{'year'} % 100 == $args->{'year_100'})
769 4 239 if (defined $args->{'time_zone_abbreviation'} and defined $args->{'time_zone_offset'})
771 3 1 unless ($self->{'zone_map'}{$args->{'time_zone_abbreviation'}} and $self->{'zone_map'}{$args->{'time_zone_abbreviation'}} eq $args->{'time_zone_offset'})
783 28 212 if (defined $args->{'epoch'})
786 24 116 if (defined $args->{$key} and $dt->$key != $args->{$key})
787 3 18 $key eq 'day_of_year' ? :
3 21 $key eq 'hour_12' ? :
799 4 212 if (defined $args->{'month'} and defined $args->{'day_of_year'})
800 3 1 unless ($dt->month == $args->{'month'})
808 44 169 if (defined $args->{'day_name'})
810 0 44 unless defined $dow
814 3 41 unless ($dt->day_of_week_0 == $dow)
824 4 206 if (defined $args->{'day_of_week'})
825 3 1 unless ($dt->day_of_week == $args->{'day_of_week'})
835 4 203 if (defined $args->{'day_of_week_sun_0'})
836 3 1 unless ($dt->day_of_week % 7 == $args->{'day_of_week_sun_0'})
846 4 200 if (defined $args->{'iso_week_year'})
847 3 1 unless ($dt->week_year == $args->{'iso_week_year'})
857 4 197 if (defined $args->{'iso_week_year_100'})
858 3 1 unless (0 + substr($dt->week_year, -2) == $args->{'iso_week_year_100'})
869 4 194 if (defined $args->{'week_mon_1'})
870 3 1 unless (0 + $dt->strftime("%W") == $args->{'week_mon_1'})
880 4 191 if (defined $args->{'week_sun_0'})
881 3 1 unless (0 + $dt->strftime("%U") == $args->{'week_sun_0'})
904 29 0 $self->{'locale'}->can('code') ? :
938 32 65 if ref $self->{'on_error'}
939 33 32 if $self->{'on_error'} eq "croak"