Branch Coverage

blib/lib/Time/Period.pm
Criterion Covered Total %
branch 273 276 98.9


line true false branch
250 2 207 if $time =~ /\D/ or $time eq ''
252 1 206 unless defined $period
256 1 205 if $period eq ''
258 1 204 if $period eq 'none'
289 3 201 if $lb != $rb or $lb == 0
297 0 201 if $lb != @scales
308 1 202 unless $scale =~ /^([a-z]*)\s*{\s*(.*)/
316 8 194 if (length $scale > 3) { }
193 1 elsif (length $scale > 1) { }
318 1 7 unless defined $scaleCode{$scale}
323 1 192 unless defined $scaleCodeV{$scale}
336 199 0 unless defined $scaleResults{$scale}
344 127 71 if ($range =~ /(.*)-(.*)/) { }
347 2 125 unless $v1 =~ /\w/ and $v2 =~ /\w/
349 1 70 unless $range =~ /\w/
357 78 117 if $result == -1
358 80 37 if $result == 1
370 38 80 if $scaleResults{$scale} == 0
375 78 38 if $i == 1
433 130 1001 if (0 == $wd[$i] and 1 != $md)
448 9 8 if ($range =~ /(.*)-(.*)/) { }
451 2 7 if $v1 =~ /\D/ or $v2 =~ /\D/
452 0 7 if $v1 < 0 or $v2 < 0
453 1 6 if $v1 > 99 and $v1 < 1970
454 1 5 if $v2 > 99 and $v2 < 1970
455 1 4 if $v1 <= 99
456 1 4 if $v2 <= 99
457 1 4 if ($v1 > $v2)
463 3 2 if $v1 <= $yr and $yr <= $v2
465 1 6 if $range =~ /\D/ or $range < 0 or $range > 99 and $range < 1970
467 1 5 if $range <= 99
469 4 2 if $range == $yr
492 19 8 if ($range =~ /(.*)-(.*)/) { }
495 12 7 if ($v1 =~ /[a-z]/) { }
1 6 elsif ($v1 =~ /\D/) { }
497 1 11 unless defined $moV{$v1}
503 2 4 if $v1 < 0 or $v1 > 11
505 11 4 if ($v2 =~ /[a-z]/) { }
1 3 elsif ($v2 =~ /\D/) { }
507 1 10 unless defined $moV{$v2}
513 2 1 if $v2 < 0 or $v2 > 11
515 6 5 if ($v1 > $v2) { }
516 5 1 if $v1 <= $mo or $v2 >= $mo
518 3 2 if $v1 <= $mo and $mo <= $v2
521 4 4 if ($range =~ /[a-z]/) { }
1 3 elsif ($range =~ /\D/) { }
523 1 3 unless defined $moV{$range}
529 2 1 if $range < 0 or $range > 11
531 3 1 if $range == $mo
544 12 7 if ($range =~ /(.*)-(.*)/) { }
547 2 10 if $v1 =~ /\D/ or $v2 =~ /\D/
550 2 8 if $v1 < 0 or $v1 > 5
551 2 6 if $v2 < 0 or $v2 > 5
552 3 3 if ($v1 > $v2) { }
553 2 1 if $v1 <= $wk or $v2 >= $wk
555 1 2 if $v1 <= $wk and $wk <= $v2
558 1 6 if $range =~ /\D/
560 2 4 if $range < 0 or $range > 5
561 3 1 if $range == $wk
575 12 7 if ($range =~ /(.*)-(.*)/) { }
578 2 10 if $v1 =~ /\D/ or $v2 =~ /\D/
581 2 8 if $v1 < 0 or $v1 > 365
582 2 6 if $v2 < 0 or $v2 > 365
583 3 3 if ($v1 > $v2) { }
584 2 1 if $v1 <= $yd or $v2 >= $yd
586 1 2 if $v1 <= $yd and $yd <= $v2
590 1 4 if $range =~ /\D/ or $range < 0 or $range > 365
591 3 1 if $range == $yd
605 12 6 if ($range =~ /(.*)-(.*)/) { }
608 2 10 if $v1 =~ /\D/ or $v2 =~ /\D/
609 2 8 if $v1 < 1 or $v1 > 31
610 2 6 if $v2 < 1 or $v2 > 31
611 3 3 if ($v1 > $v2) { }
612 2 1 if $v1 <= $md or $v2 >= $md
614 1 2 if $v1 <= $md and $md <= $v2
617 2 3 if $range =~ /\D/ or $range < 1 or $range > 31
618 2 1 if $range == $md
640 19 13 if ($range =~ /(.*)-(.*)/) { }
643 11 8 if ($v1 =~ /[a-z]/) { }
1 7 elsif ($v1 =~ /\D/) { }
645 1 10 unless defined $wdV{$v1}
651 2 5 if $v1 < 0 or $v1 > 6
653 11 4 if ($v2 =~ /[a-z]/) { }
1 3 elsif ($v2 =~ /\D/) { }
655 1 10 unless defined $wdV{$v2}
661 2 1 if $v2 < 0 or $v2 > 6
663 7 4 if ($v1 > $v2) { }
664 6 1 if $v1 <= $wd or $v2 >= $wd
666 2 2 if $v1 <= $wd and $wd <= $v2
669 9 4 if ($range =~ /[a-z]/) { }
1 3 elsif ($range =~ /\D/) { }
671 1 8 unless defined $wdV{$range}
677 2 1 if $range < 0 or $range > 6
679 7 2 if $range == $wd
692 22 11 if ($range =~ /(.*)-(.*)/) { }
695 2 20 if ($v1 =~ /^(\d+)am$/) { }
2 18 elsif ($v1 =~ /^(\d+)pm$/) { }
2 16 elsif ($v1 =~ /^(\d+)noon$/) { }
696 1 1 if ($1 == 12) { }
702 1 1 if ($1 == 12) { }
708 1 1 if $1 != 12
711 2 19 if ($v2 =~ /^(\d+)am$/) { }
2 17 elsif ($v2 =~ /^(\d+)pm$/) { }
2 15 elsif ($v2 =~ /^(\d+)noon$/) { }
712 1 1 if ($1 == 12) { }
718 1 1 if ($1 == 12) { }
724 1 1 if $1 != 12
727 1 18 if $v1 =~ /\D/ or $v1 < 0 or $v1 > 23
728 1 16 if $v2 =~ /\D/ or $v2 < 0 or $v2 > 23
730 4 12 if ($v1 > $v2) { }
731 3 1 if $v1 <= $hr or $v2 >= $hr
733 10 2 if $v1 <= $hr and $hr <= $v2
736 2 9 if ($range =~ /^(\d+)am$/) { }
2 7 elsif ($range =~ /^(\d+)pm$/) { }
2 5 elsif ($range =~ /^(\d+)noon$/) { }
737 1 1 if ($1 == 12) { }
743 1 1 if ($1 == 12) { }
749 1 1 if $1 != 12
752 1 8 if $range =~ /\D/ or $range < 0 or $range > 23
753 7 1 if $range == $hr
766 10 5 if ($range =~ /(.*)-(.*)/) { }
769 2 8 if $v1 =~ /\D/ or $v2 =~ /\D/
770 1 7 if $v1 < 0 or $v1 > 59
771 1 6 if $v2 < 0 or $v2 > 59
772 3 3 if ($v1 > $v2) { }
773 2 1 if $v1 <= $min or $v2 >= $min
775 1 2 if $v1 <= $min and $min <= $v2
778 1 3 if $range =~ /\D/ or $range < 0 or $range > 59
779 2 1 if $range == $min
792 10 5 if ($range =~ /(.*)-(.*)/) { }
795 2 8 if $v1 =~ /\D/ or $v2 =~ /\D/
796 1 7 if $v1 < 0 or $v1 > 59
797 1 6 if $v2 < 0 or $v2 > 59
798 3 3 if ($v1 > $v2) { }
799 2 1 if $v1 <= $sec or $v2 >= $sec
801 1 2 if $v1 <= $sec and $sec <= $v2
804 1 3 if $range =~ /\D/ or $range < 0 or $range > 59
805 2 1 if $range == $sec