Branch Coverage

blib/lib/DateTime/Format/Natural.pm
Criterion Covered Total %
branch 131 154 85.0


line true false branch
67 7004 0 if (defined $opts{$opt})
74 0 10812 unless eval "require $mod"
94 1072 1 unless exists $_[1]{'prefer_future'}
120 1090 0 unless exists $_[1]{'demand_future'}
132 1 1561 if (builtin::blessed($val)) { }
150 0 39 if (&any(sub {
0 39 elsif (&any(sub {
0 39 elsif (&any(sub {
0 39 elsif (&any(sub {
159 58 0 unless $href->{$_} < 0
175 26 0 if builtin::blessed($obj)
209 271 11664 if ($self->_check_formatted('ymd', \%count)) { }
193 11471 elsif ($self->_check_formatted('md', \%count)) { }
29 11442 elsif ($date_string =~ /^(\d{4}(?:-\d{2}){0,2})T(\d{2}(?::\d{2}){0,2})(?:[.,](\d+))?(Z|[+-]\d{2}(?::?\d{2})?)?$/) { }
14 11428 elsif ($date_string =~ /^([+-]) (\d+?) ([a-zA-Z]+)$/x) { }
6 11422 elsif ($date_string =~ /^\d{14}$/) { }
211 1 270 if builtin::blessed($dt)
215 1 192 if builtin::blessed($dt)
217 36 156 if ($self->{'Prefer_future'} or $self->{'Demand_future'})
225 15 14 if (defined $tz)
226 3 12 if ($tz eq 'Z') { }
5 7 elsif ($tz =~ /^([+-])(\d{2})$/) { }
242 7 22 if (defined $fractional)
244 6 1 if (length $nanosecond < 9)
253 0 29 unless ($valid_date and $valid_time)
254 0 0 !$valid_date ? :
272 2 12 if (&none(sub {
288 0 6 unless ($valid_date and $valid_time)
289 0 0 !$valid_date ? :
310 11569 362 if (defined $trace)
322 0 13402 if (@_ > 1) { }
347 24 2905 if (exists $self->{'Datetime'} and $method eq 'now') { }
358 9006 2929 if ($self->{'running_tests'}) { }
385 1039 219 $duration_string =~ /\s+ $timespan_sep \s+/xi ? :
391 1 1257 if (@date_strings > $max)
410 2292 5 if (@{$self->{'traces'};})
413 1932 365 if ($self->{'running_tests'})
427 1 1257 if ($shrinked)
452 208 1 if @expressions
454 207 2 wantarray ? :
461 10470 364 $self->_get_valid_exp && !$self->_get_failure ? :
468 1 5 if $self->success
472 1 4 unless defined $self->{'mode'} and length $self->{'mode'}
480 4 1 if (defined $error) { }
494 1 6 unless $self->{'traces'}
503 10625 1118 unless (exists $self->{'lookup'})
507 201875 541875 if ($self->_expand_for($keyword))
513 0 11743 unless $self->{'lookup'}{$self->{'count'}{'tokens'}}
519 19690 110301 if $expandable
522 281547 453337 $expandable ? :
528 94187 762873 if ($types->[$pos] eq 'SCALAR') { }
762873 0 elsif ($types->[$pos] eq 'REGEXP') { }
529 94187 0 if (defined $definition->{$pos})
530 6417 87770 if (${$self->_token($pos);} =~ /^$definition->{$pos}$/i) { }
540 127506 635367 if (my(@captured) = ${$self->_token($pos);} =~ /$definition->{$pos}/) { }
555 8765 726119 if ($valid_expression and @{$expression->[2];})
561 366 10701 unless ($valid_expression)
567 11381 723503 if ($valid_expression)
569 585 10796 unless $expression->[6]{'truncate_to'}
574 18423 6564 ref $pos eq 'HASH' ? :
581 270 18153 $index eq 'VALUE' ? :
6564 0 exists $first_stack{$index} ? :
18423 6564 ref $pos ? :
602 7906 11945 unless defined $truncate_to
604 8322 3623 if ($_ =~ /_/) { }
610 11891 8986 if (defined $units[$index] and not exists $self->{'modified'}{$units[$index]})
625 2070 0 if ($self->{'Prefer_future'} || $self->{'Demand_future'} and (exists $opts{'advance_future'} and $opts{'advance_future'}))
652 18 2088 exists $self->{'Datetime'} ? :
658 66 0 $self->{'modified'}{'day'} == 1 ? :
66 24 exists $self->{'modified'}{'day'} ? :
234 1872 if (&all(sub {
18 1854 elsif (sub {
1188 666 elsif (&$token_contains('weekdays_all') and not $skip_weekdays and (exists $self->{'modified'}{'day'} and $self->{'modified'}{'day'} == 1) and $self->{'Prefer_future'} && &$day_of_week($self) < $now->wday || $self->{'Demand_future'} && &$day_of_week($self) <= $now->wday) { }
72 606 elsif (&$token_contains('months_all') || $advance{'md'} and &all(sub {
666 474 1398 unless @{$self->{'tokens'};} == 2
668 36 1362 if ($self->{'tokens'}[0] =~ /$day/ and $self->{'tokens'}[1] =~ /$weekday/)
710 857060 0 defined $token ? :