Branch Coverage

blib/lib/Time/Str.pm
Criterion Covered Total %
branch 124 136 91.1


line true false branch
662 6 46 if $m == 2 and leap_year($y)
687 0 41 unless @_ == 2
690 0 41 unless $pivot_year >= 0 and $pivot_year <= 9899
699 25 16 if ($yy < $pivot_offset)
706 0 22 unless @_ == 2
709 0 22 unless $hour >= 1 and $hour <= 12
712 0 22 unless $meridiem eq "AM" or $meridiem eq "PM"
715 2 5 $hour == 12 ? :
4 11 $hour == 12 ? :
7 15 $meridiem eq 'AM' ? :
720 0 265 unless @_ == 1
724 0 265 unless my($sign, $h, $m) = $string =~ /^([+-])([0-9]{1,2})([0-9]{2})?$/
728 1 264 unless valid_hm($h, $m)
732 86 178 if ($sign eq "-")
771 2 813 unless @_ & 1
777 804 9 if ($name eq 'format') { }
8 1 elsif ($name eq 'pivot_year') { }
780 1 803 unless defined $regexp
785 2 6 unless $pivot_year >= 0 and $pivot_year <= 9899
793 2 807 unless defined $string and $string =~ /$regexp/x
798 41 766 if (length $r{'year'} == 2)
802 248 559 if (exists $r{'month'} and not $r{'month'} =~ /^[0-9]/)
806 6 801 unless valid_ymd($r{'year'}, $r{'month'} // 1, $r{'day'} // 1)
809 679 122 if (exists $r{'hour'})
811 22 657 if (exists $r{'meridiem'})
812 0 22 unless $r{'hour'} >= 1 and $r{'hour'} <= 12
818 6 673 unless valid_hms($r{'hour'}, $r{'minute'} // 0, $r{'second'} // 0)
821 277 396 if (exists $r{'fraction'})
825 246 31 if (exists $r{'second'}) { }
16 15 elsif (exists $r{'minute'}) { }
834 6 10 if ($nsec != 0)
846 2 13 if ($sec != 0 or $nsec != 0)
848 1 1 if ($nsec != 0)
855 265 408 if (exists $r{'tz_offset'})
859 361 311 if (exists $r{'tz_utc'})
864 2 792 if ($regexp == $RFC2616_Rx and not $r{'tz_utc'})
873 0 794 wantarray ? :
877 2 157 unless @_ & 1
882 60 97 if (exists $p{'precision'})
884 2 58 unless $precision >= 0 and $precision <= 9
891 2 153 unless exists $r->{'tz_offset'}
899 67 86 if ($M < 3)
907 58 95 if (exists $r->{'nanosecond'})
922 25 14 if ($offset == 0) { }
926 6 8 $offset < 0 ? :
935 38 11 if ($offset == 0) { }
939 4 7 $offset < 0 ? :
1008 2 2 if ($time < 2524608000) { }
1101 2 111 unless @_ & 1
1104 2 109 unless $time >= '-62135596800' and $time < '253402300800'
1110 100 97 if ($name eq 'format') { }
45 52 elsif ($name eq 'precision') { }
22 30 elsif ($name eq 'nanosecond') { }
29 1 elsif ($name eq 'offset') { }
1112 1 99 unless defined $formatter
1117 2 43 unless $precision >= 0 and $precision <= 9
1122 2 20 unless $nanosecond >= 0 and $nanosecond <= 999999999
1127 2 27 unless $offset >= -1439 and $offset <= 1439
1135 29 72 if (not defined $nanosecond and int $time != $time)
1144 4 25 if ($nanosecond >= 1000000000)
1150 27 74 if ($offset)
1153 2 25 unless $local_time >= '-62135596800' and $local_time <= '253402300799'
1158 49 50 if (defined $nanosecond or defined $precision)
1160 6 43 unless (defined $precision)
1161 4 2 if ($nanosecond == 0) { }
2 0 elsif ($nanosecond % 1000000 == 0) { }
0 0 elsif ($nanosecond % 1000 == 0) { }
1175 41 8 if ($precision != 0)