Branch Coverage

blib/lib/DateTime/Format/Natural.pm
Criterion Covered Total %
branch 116 134 86.5


line true false branch
67 7003 0 if (defined $opts{$opt})
74 0 10580 unless eval "require $mod"
94 1072 0 unless exists $_[1]{'prefer_future'}
120 1090 1 unless exists $_[1]{'demand_future'}
132 1 1561 if (&blessed($val)) { }
153 26 0 if &blessed($obj)
187 271 11432 if ($self->_check_formatted('ymd', \%count)) { }
193 11239 elsif ($self->_check_formatted('md', \%count)) { }
9 11230 elsif ($date_string =~ /^(\d{4}(?:-\d{2}){0,2})T(\d{2}(?::\d{2}){0,2})$/) { }
14 11216 elsif ($date_string =~ /^([+-]) (\d+?) ([a-zA-Z]+)$/x) { }
6 11210 elsif ($date_string =~ /^\d{14}$/) { }
189 1 270 if &blessed($dt)
193 1 192 if &blessed($dt)
195 36 156 if ($self->{'Prefer_future'} or $self->{'Demand_future'})
213 0 9 unless ($valid_date and $valid_time)
214 0 0 !$valid_date ? :
235 2 12 if (&none(sub {
251 0 6 unless ($valid_date and $valid_time)
252 0 0 !$valid_date ? :
273 11339 360 if (defined $trace)
285 0 13170 if (@_ > 1) { }
310 24 2883 if (exists $self->{'Datetime'} and $method eq 'now') { }
321 8796 2907 if ($self->{'running_tests'}) { }
348 1039 219 $duration_string =~ /\s+ $timespan_sep \s+/xi ? :
354 1 1257 if (@date_strings > $max)
373 2292 5 if (@{$self->{'traces'};})
376 1932 365 if ($self->{'running_tests'})
390 1 1257 if ($shrinked)
415 208 1 if @expressions
417 207 2 wantarray ? :
424 10240 362 $self->_get_valid_exp && !$self->_get_failure ? :
431 1 5 if $self->success
435 1 4 unless defined $self->{'mode'} and length $self->{'mode'}
443 4 1 if (defined $error) { }
457 1 6 unless $self->{'traces'}
466 10414 1117 unless (exists $self->{'lookup'})
470 197866 499872 if ($self->_expand_for($keyword))
476 0 11531 unless $self->{'lookup'}{$self->{'count'}{'tokens'}}
482 16418 83809 if $expandable
485 243165 350675 $expandable ? :
491 68728 642690 if ($types->[$pos] eq 'SCALAR') { }
642690 0 elsif ($types->[$pos] eq 'REGEXP') { }
492 68728 0 if (defined $definition->{$pos})
493 6189 62539 if (${$self->_token($pos);} =~ /^$definition->{$pos}$/i) { }
503 122926 519764 if (my(@captured) = ${$self->_token($pos);} =~ /$definition->{$pos}/) { }
518 8573 585267 if ($valid_expression and @{$expression->[2];})
524 366 10473 unless ($valid_expression)
530 11171 582669 if ($valid_expression)
532 585 10586 unless $expression->[6]{'truncate_to'}
537 18171 6462 ref $pos eq 'HASH' ? :
544 234 17937 $index eq 'VALUE' ? :
6462 0 exists $first_stack{$index} ? :
18171 6462 ref $pos ? :
565 7741 11819 unless defined $truncate_to
567 8148 3671 $_ =~ /_/ ? :
573 11765 8728 if (defined $units[$index] and not exists $self->{'modified'}{$units[$index]})
588 2070 0 if ($self->{'Prefer_future'} || $self->{'Demand_future'} and (exists $opts{'advance_future'} and $opts{'advance_future'}))
615 18 2088 exists $self->{'Datetime'} ? :
621 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 {
629 474 1398 unless @{$self->{'tokens'};} == 2
631 36 1362 if ($self->{'tokens'}[0] =~ /$day/ and $self->{'tokens'}[1] =~ /$weekday/)
673 711418 0 defined $token ? :