Branch Coverage

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


line true false branch
255 2 209 if $time =~ /\D/ or $time eq ''
257 1 208 unless defined $period
261 1 207 if $period eq ''
263 1 206 if $period eq 'none'
294 3 203 if $lb != $rb or $lb == 0
302 0 203 if $lb != @scales
313 1 204 unless $scale =~ /^([a-z]*)\s*{\s*(.*)/
321 8 196 if (length $scale > 3) { }
195 1 elsif (length $scale > 1) { }
323 1 7 unless defined $scaleCode{$scale}
328 1 194 unless defined $scaleCodeV{$scale}
341 201 0 unless defined $scaleResults{$scale}
349 127 73 if ($range =~ /(.*)-(.*)/) { }
352 2 125 unless $v1 =~ /\w/ and $v2 =~ /\w/
354 1 72 unless $range =~ /\w/
362 78 119 if $result == -1
363 82 37 if $result == 1
375 38 82 if $scaleResults{$scale} == 0
380 80 38 if $i == 1
438 132 1009 if ($wd[$i] == 0 and $i != 1)
453 9 8 if ($range =~ /(.*)-(.*)/) { }
456 2 7 if $v1 =~ /\D/ or $v2 =~ /\D/
457 0 7 if $v1 < 0 or $v2 < 0
458 1 6 if $v1 > 99 and $v1 < 1970
459 1 5 if $v2 > 99 and $v2 < 1970
460 1 4 if $v1 <= 99
461 1 4 if $v2 <= 99
462 1 4 if ($v1 > $v2)
468 3 2 if $v1 <= $yr and $yr <= $v2
470 1 6 if $range =~ /\D/ or $range < 0 or $range > 99 and $range < 1970
472 1 5 if $range <= 99
474 4 2 if $range == $yr
497 19 8 if ($range =~ /(.*)-(.*)/) { }
500 12 7 if ($v1 =~ /[a-z]/) { }
1 6 elsif ($v1 =~ /\D/) { }
502 1 11 unless defined $moV{$v1}
508 2 4 if $v1 < 0 or $v1 > 11
510 11 4 if ($v2 =~ /[a-z]/) { }
1 3 elsif ($v2 =~ /\D/) { }
512 1 10 unless defined $moV{$v2}
518 2 1 if $v2 < 0 or $v2 > 11
520 6 5 if ($v1 > $v2) { }
521 5 1 if $v1 <= $mo or $v2 >= $mo
523 3 2 if $v1 <= $mo and $mo <= $v2
526 4 4 if ($range =~ /[a-z]/) { }
1 3 elsif ($range =~ /\D/) { }
528 1 3 unless defined $moV{$range}
534 2 1 if $range < 0 or $range > 11
536 3 1 if $range == $mo
549 12 8 if ($range =~ /(.*)-(.*)/) { }
552 2 10 if $v1 =~ /\D/ or $v2 =~ /\D/
555 2 8 if $v1 < 0 or $v1 > 5
556 2 6 if $v2 < 0 or $v2 > 5
557 3 3 if ($v1 > $v2) { }
558 2 1 if $v1 <= $wk or $v2 >= $wk
560 1 2 if $v1 <= $wk and $wk <= $v2
563 1 7 if $range =~ /\D/
565 2 5 if $range < 0 or $range > 5
566 4 1 if $range == $wk
580 12 7 if ($range =~ /(.*)-(.*)/) { }
583 2 10 if $v1 =~ /\D/ or $v2 =~ /\D/
586 2 8 if $v1 < 0 or $v1 > 365
587 2 6 if $v2 < 0 or $v2 > 365
588 3 3 if ($v1 > $v2) { }
589 2 1 if $v1 <= $yd or $v2 >= $yd
591 1 2 if $v1 <= $yd and $yd <= $v2
595 1 4 if $range =~ /\D/ or $range < 0 or $range > 365
596 3 1 if $range == $yd
610 12 6 if ($range =~ /(.*)-(.*)/) { }
613 2 10 if $v1 =~ /\D/ or $v2 =~ /\D/
614 2 8 if $v1 < 1 or $v1 > 31
615 2 6 if $v2 < 1 or $v2 > 31
616 3 3 if ($v1 > $v2) { }
617 2 1 if $v1 <= $md or $v2 >= $md
619 1 2 if $v1 <= $md and $md <= $v2
622 2 3 if $range =~ /\D/ or $range < 1 or $range > 31
623 2 1 if $range == $md
645 19 14 if ($range =~ /(.*)-(.*)/) { }
648 11 8 if ($v1 =~ /[a-z]/) { }
1 7 elsif ($v1 =~ /\D/) { }
650 1 10 unless defined $wdV{$v1}
656 2 5 if $v1 < 0 or $v1 > 6
658 11 4 if ($v2 =~ /[a-z]/) { }
1 3 elsif ($v2 =~ /\D/) { }
660 1 10 unless defined $wdV{$v2}
666 2 1 if $v2 < 0 or $v2 > 6
668 7 4 if ($v1 > $v2) { }
669 6 1 if $v1 <= $wd or $v2 >= $wd
671 2 2 if $v1 <= $wd and $wd <= $v2
674 10 4 if ($range =~ /[a-z]/) { }
1 3 elsif ($range =~ /\D/) { }
676 1 9 unless defined $wdV{$range}
682 2 1 if $range < 0 or $range > 6
684 8 2 if $range == $wd
697 22 11 if ($range =~ /(.*)-(.*)/) { }
700 2 20 if ($v1 =~ /^(\d+)am$/) { }
2 18 elsif ($v1 =~ /^(\d+)pm$/) { }
2 16 elsif ($v1 =~ /^(\d+)noon$/) { }
701 1 1 if ($1 == 12) { }
707 1 1 if ($1 == 12) { }
713 1 1 if $1 != 12
716 2 19 if ($v2 =~ /^(\d+)am$/) { }
2 17 elsif ($v2 =~ /^(\d+)pm$/) { }
2 15 elsif ($v2 =~ /^(\d+)noon$/) { }
717 1 1 if ($1 == 12) { }
723 1 1 if ($1 == 12) { }
729 1 1 if $1 != 12
732 1 18 if $v1 =~ /\D/ or $v1 < 0 or $v1 > 23
733 1 16 if $v2 =~ /\D/ or $v2 < 0 or $v2 > 23
735 4 12 if ($v1 > $v2) { }
736 3 1 if $v1 <= $hr or $v2 >= $hr
738 10 2 if $v1 <= $hr and $hr <= $v2
741 2 9 if ($range =~ /^(\d+)am$/) { }
2 7 elsif ($range =~ /^(\d+)pm$/) { }
2 5 elsif ($range =~ /^(\d+)noon$/) { }
742 1 1 if ($1 == 12) { }
748 1 1 if ($1 == 12) { }
754 1 1 if $1 != 12
757 1 8 if $range =~ /\D/ or $range < 0 or $range > 23
758 7 1 if $range == $hr
771 10 5 if ($range =~ /(.*)-(.*)/) { }
774 2 8 if $v1 =~ /\D/ or $v2 =~ /\D/
775 1 7 if $v1 < 0 or $v1 > 59
776 1 6 if $v2 < 0 or $v2 > 59
777 3 3 if ($v1 > $v2) { }
778 2 1 if $v1 <= $min or $v2 >= $min
780 1 2 if $v1 <= $min and $min <= $v2
783 1 3 if $range =~ /\D/ or $range < 0 or $range > 59
784 2 1 if $range == $min
797 10 5 if ($range =~ /(.*)-(.*)/) { }
800 2 8 if $v1 =~ /\D/ or $v2 =~ /\D/
801 1 7 if $v1 < 0 or $v1 > 59
802 1 6 if $v2 < 0 or $v2 > 59
803 3 3 if ($v1 > $v2) { }
804 2 1 if $v1 <= $sec or $v2 >= $sec
806 1 2 if $v1 <= $sec and $sec <= $v2
809 1 3 if $range =~ /\D/ or $range < 0 or $range > 59
810 2 1 if $range == $sec