Branch Coverage

blib/lib/App/JobLog/TimeGrammar.pm
Criterion Covered Total %
branch 148 206 71.8


line true false branch
74 0 461 if $time_buffer
166 41 42 if $b1
175 2 30 if $b1
185 6 5 if $b1
312 0 416 if $suffix eq 'p' and $hour < 12
313 0 416 if $hour > 11
314 0 416 if $hour == 12 and $suffix eq 'a'
315 0 416 if $hour > 23 or $minute > 59 or $second > 59 or $suffix eq 'a' and $hour > 12
322 0 416 if $suffix eq 'a' and $hour == 12
335 445 0 if ($phrase =~ m[ \A \s*+ (?: (?&ever) | (?&span) ) \s*+ \Z (?(DEFINE) (? (?: all | always | ever | (?:(?:the \s++)? (?: entire | whole ) \s++ )? log ) (?{ $matches{'ever'} = 1; }) ) (? ((?&date)) (?{ $d1 = $^N; stow($d1); }) (?: (?&span_divider) ((?&date)) (?{ $d2 = $^N; stow($d2); }) )? ) (? \s*+ (?: -++ | \b(?: through | thru | to | till?+ | until )\b ) \s*+) (? at | @ ) (? (?{ $time_buffer = undef; }) (?: (?: \s++ | \s*+ (?&at) \s*+ ) (?&time))? ) (? (?:(?&at) \s++)? (?&time) \s++ on \s++ ) (? (?{ (%buffer, $b1, $b2, $time_buffer) = (); }) (?: (?&numeric) | (?&verbal) ) (?{ $buffer{'time'} = $time_buffer if $time_buffer; }) ) (?
336 0 445 if ($matches{'ever'})
340 0 0 if ($se) { }
351 4 441 if ($unit) { }
361 20 421 if ($d2 and $matches{$d2}) { }
375 356 85 if (is_fixed($h1)) { }
1 84 elsif (is_fixed($h2)) { }
384 0 441 unless 'DateTime'->compare($h1, $h2) <= 0
388 0 441 if ($h1 > $h2)
389 0 0 if ($h1->year == $h2->year and $h1->month == $h2->month and $h1->day == $h2->day and $h2->hour < 12 and $s2 eq 'x') { }
413 3 0 if (keys %$h1 == 2 and keys %$h2 == 2 and $h1->{'period'} and $h2->{'period'})
423 416 45 if (defined $time) { }
431 30 15 $is_start ? :
441 0 1 if (is_fixed($h1)) { }
447 1 0 if (ref $h1 eq 'DateTime') { }
468 0 81 if $delta <= 0
476 82 90 if ($h->{'type'} eq 'numeric') { }
477 82 0 if exists $h->{'month'}
481 2 88 if (my $period = $h->{'period'}) { }
489 7 81 if exists $h->{'month'}
490 81 0 if exists $h->{'day'}
500 164 192 unless ($two_endpoints or $h2->{'type'} ne 'numeric')
501 163 1 if defined $h2->{'day'}
504 189 3 if (is_fixed($h2)) { }
510 1 2 unless ref $h2 eq 'DateTime'
522 82 90 if $h->{'type'} eq 'numeric'
527 2 88 if (my $period = $h->{'period'}) { }
532 0 0 unless $is_start
536 0 0 if sunday_begins_week()
537 0 0 unless $is_start
544 1 1 unless $is_start
550 1 1 unless $is_start
554 81 7 if (exists $h->{'day'} and not $h->{'day'} =~ /^\d++$/u)
560 7 0 if (exists $h->{'month'})
578 2 87 unless (exists $h->{'day'} or $is_start)
587 363 187 if ($d->{'type'} eq 'verbal')
588 247 116 if ($d->{'year'}) { }
95 21 elsif (my $day = $d->{'day'}) { }
596 10 85 if $day eq 'tod'
597 2 83 if ($day eq 'yes') { }
3 80 elsif ($day eq 'tom') { }
608 0 80 if ($d->{'modifier'} eq 'this') { }
609 0 0 if $day_num == $todays_num
610 0 0 $day_num > $todays_num ? :
619 0 80 if ($day_num < $todays_num) { }
0 80 elsif ($day_num > $todays_num) { }
626 0 80 if $d->{'modifier'} eq 'next'
631 17 4 if (my $period = $d->{'period'})
633 10 7 if ($d->{'modifier'} eq 'this') { }
637 2 2 unless $is_start
642 2 0 if (sunday_begins_week())
643 0 2 $is_sunday ? :
645 1 1 unless $is_start
649 1 1 unless $is_start
656 1 1 unless $is_start
660 5 5 unless $is_start
666 0 0 if ($is_start) { }
672 0 0 if $d->{'modifier'} eq 'next'
677 5 0 if (sunday_begins_week())
678 0 5 $is_sunday ? :
680 3 2 if ($is_start) { }
686 0 5 if $d->{'modifier'} eq 'next'
690 1 1 if ($is_start) { }
696 0 2 if $d->{'modifier'} eq 'next'
703 0 0 if ($is_start) { }
710 0 0 if $d->{'modifier'} eq 'next'
722 2 2 if ($d->{'modifier'} eq 'this') { }
724 0 2 if ($todays_num > $month_num) { }
2 0 elsif ($todays_num < $month_num) { }
730 1 1 unless $is_start
735 0 2 if ($todays_num > $month_num) { }
2 0 elsif ($todays_num < $month_num) { }
741 1 1 unless $is_start
744 2 2 unless $is_start
755 2 258 unless (%month_abbr)
763 1 160 unless (%day_abbr)
783 2 82 if $two_endpoints
788 40 44 unless ref $h2 eq 'DateTime'
789 40 44 unless ref $h1 eq 'DateTime'
797 2 82 if ($two_endpoints)
812 0 2 if ($h1->{'type'} eq $h2->{'type'}) { }
2 0 elsif ($h2->{'type'} eq 'numeric') { }
821 2 0 if ($h1->{'month'} and not $h2->{'month'})
836 236 229 if ($h->{'type'} eq 'verbal')
838 362 346 if (my $value = $h->{$key})
839 126 236 if $value =~ /\d/u
841 3 233 if ($value =~ /^p/u) { }
842 0 3 unless defined start_pay_period()
866 430 289 if exists $h->{'year'}
867 207 82 if ($h->{'type'} eq 'verbal')
868 101 106 if (exists $h->{'modifier'})
869 101 0 if $h->{'modifier'} =~ /this|last|next/u
871 100 6 if (exists $h->{'day'})
872 15 85 if $h->{'day'} =~ /yes|tod|tom/u