Branch Coverage

blib/lib/Advanced/Config/Date.pm
Criterion Covered Total %
branch 220 448 49.1


line true false branch
154 0 0 $k eq $mod ? :
274 980 0 if $Months{$_} > 0
275 0 0 if ($flip) { }
283 1736 1736 if $Days{$_} > 0
284 0 1736 if ($flip) { }
358 0 0 $k1 eq lc $lang ? :
362 0 0 if (scalar keys %languages == 0)
376 2 2 if ($ok)
407 0 114 unless ($sts)
423 0 0 if ($#lMoY == -1 and $#lMoYs == -1 and $#lDsuf == -1 and $#lDoW == -1 and $#lDoWs == -1)
431 87 27 if ($num > 29)
447 1031 6106 if ($wide) { }
455 10 6096 if ($_ =~ /[^\x00-\xff]/ or uc($_) =~ /[^\x00-\xff]/ or lc($_) =~ /[^\x00-\xff]/)
465 1 113 if ($wide_flag and not $allow_wide)
473 26 2804 unless defined $lDsuf[$_]
475 128 2676 if $lDsuf[$_] =~ /[.]/
480 0 2712 if $_ =~ /[.]/
484 0 1582 if $_ =~ /[.]/
515 0 0 unless ($sts)
538 0 0 if $w
539 0 0 if $pe and exists $months{$alt} and $months{$alt} == $month_idx
540 0 0 if $pi or $pe
545 0 0 if $w
546 0 0 if $pe and exists $months{$alt} and $months{$alt} == $month_idx
547 0 0 if $pi or $pe
562 0 0 if $w
563 0 0 if $pe and exists $days{$alt} and $days{$alt} == $day_idx
564 0 0 if $pi or $pe
580 0 0 if $w
585 0 0 if $w
592 0 0 if ($wide and not $allow_wide)
607 0 0 $value =~ /[^\x00-\xff]/ ? :
609 0 0 unless ($wide)
614 0 0 if ($value =~ /[^\x00-\xff]/ or lc($value) =~ /[^\x00-\xff]/ or uc($value) =~ /[^\x00-\xff]/)
621 0 0 unless $keep_case
625 0 0 if ($value =~ /([.]?)[^.]*(.)$/)
626 0 0 if $1 eq "."
627 0 0 if ($2 eq ".")
650 0 210 if ($manip_ref and not $lang_ref)
655 2 208 unless ($lang_ref or $manip_ref)
660 170 38 unless ($allow_wide)
661 0 0 if $manip_ref and $manip_ref->{'Wide'}
662 1 169 if $lang_ref and $lang_ref->{'Wide'}
664 1 169 unless ($lang_ref or $manip_ref)
712 2586 62 if (not defined $lang or lc $lang eq lc $last_language_edit_flags{'language'})
718 3 59 unless ($lang_ref or $manip_ref)
723 0 59 if ($manip_ref)
729 0 0 if ($old ne $lang and not $lang_ref)
731 0 0 if $lang_ref and $lang_ref->{'Wide'} and not $allow_wide
736 59 0 if ($lang_ref)
743 1 58 unless ($MoY_ref or $month_ref)
813 1397 401 if ($Dsuf_ref and defined $Dsuf_ref->[$day])
824 0 6152 unless $Months{$a} <=> $Months{$b}
825 0 14550 if $x eq ""
0 14550 if $y eq ""
0 13211 unless $x <=> $y
871 2588 5888 unless (utf8::is_utf8($str))
904 0 0 if $last_language_edit_flags{'month_spaces'}
905 0 0 if $last_language_edit_flags{'month_period'}
906 0 0 if $last_language_edit_flags{'month_hyphin'}
911 0 0 if $last_language_edit_flags{'dsuf_spaces'}
912 0 0 if $last_language_edit_flags{'dsuf_period'}
913 0 0 if $last_language_edit_flags{'dsuf_hyphin'}
926 0 0 if ($in_date =~ /(^|\D)(\d{4})($sep)(\d{1,2})($sep)(\d{1,2})(\D|$)/) { }
0 0 elsif ($in_date =~ /(^|\D)(\d{1,2})($sep)(\d{1,2})($sep)(\d{4})(\D|$)/) { }
0 0 elsif ($in_date =~ /(^|\D)(\d{1,2})($sep)($name)[.]?($sep)(\d{4})(\D|$)/ and exists $Months{lcx($4)}) { }
0 0 elsif ($in_date =~ /(^|\D)(\d{4})($sep)($name)[.]?($sep)(\d{1,2})(\D|$)/ and exists $Months{lcx($4)}) { }
0 0 elsif ($in_date =~ /(^|\s)($name)($sep)(\d{1,2})($sep)(\d{4})(\D|$)/ and exists $Months{lcx($2)}) { }
0 0 elsif ($in_date =~ /(^|\s)($dom)($sep)($name)[.]?($sep)(\d{4})(\D|$)/ and exists $Months{lcx($4)} and exists $Days{lcx($2)}) { }
0 0 elsif ($in_date =~ /(^|\D)(\d{4})($sep)($name)[.]?($sep)($dom)(\s|$)/ and exists $Months{lcx($4)} and exists $Days{lcx($6)}) { }
0 0 elsif ($in_date =~ /(^|\s)($name)($sep)($dom)($sep)(\d{4})(\D|$)/ and exists $Months{lcx($2)} and exists $Days{lcx($4)}) { }
972 0 0 if defined $year
975 0 0 if (defined $year) { }
0 0 elsif ($in_date =~ /($name)[.\s]\s*($dom)[,\s]\s*(\d{4})(\D|$)/ and exists $Months{lcx($1)}) { }
0 0 elsif ($in_date =~ /($name)[.]?\s+($dom)[,\s]\s*(\d{1,2}:\d{1,2}(:\d{1,2})?)\s+(\d{4})(\D|$)/ and exists $Months{lcx($1)}) { }
0 0 elsif ($in_date =~ /(^|\D)(\d{8})(\D|$)/) { }
0 0 elsif ($allow_2_digit_years) { }
1003 0 0 if $sep eq ":"
1005 0 0 if ($in_date =~ /(^|[^:\d])(\d{1,2})($sep)(\d{1,2})($sep)(\d{1,2})([^:\d]|$)/) { }
0 0 elsif ($in_date =~ /(^|\D)(\d{1,2})($sep)($name)[.]?($sep)(\d{1,2})([^:\d]|$)/ and exists $Months{lcx($4)}) { }
0 0 elsif ($in_date =~ /(^|\s)($name)($sep)(\d{1,2})($sep)(\d{1,2})([^:\d]|$)/ and exists $Months{lcx($2)}) { }
0 0 elsif ($in_date =~ /(^|\s)($name)[.]?($sep)($dom)($sep)(\d{1,2})([^:\d]|$)/ and _tst($sep, $name, $dom, $2, $4, $6) and exists $Months{lcx($2)} and exists $Days{lcx($4)}) { }
0 0 elsif ($in_date =~ /(^|\s)($dom)($sep)($name)[.]?($sep)(\d{1,2})([^:\d]|$)/ and _tst($sep, $name, $dom, $2, $4, $6) and exists $Months{lcx($4)} and exists $Days{lcx($2)}) { }
0 0 elsif ($in_date =~ /(^|\D)(\d{1,2})($sep)($name)[.]?($sep)($dom)(\s|$)/ and _tst($sep, $name, $dom, $2, $4, $6) and exists $Months{lcx($4)} and exists $Days{lcx($6)}) { }
1018 0 0 if $_ != 2
1055 0 0 if defined $year
1058 0 0 if (defined $year) { }
0 0 elsif ($in_date =~ /($name)[.\s]\s*($dom)[,\s]\s*(\d{2})(\D|$)/ and _tst('\\s', $name, $dom, $1, $2, $3) and exists $Months{lcx($1)}) { }
0 0 elsif ($in_date =~ /(^|\D)(\d{6})(\D|$)/) { }
1083 0 0 if ($use_date_language_module and not defined $year)
1084 0 0 if (_date_language_installed()) { }
1091 0 0 if (defined $t)
1104 0 0 if (not defined $year) { }
1115 0 0 if ($s1 ne $s2)
1116 0 0 unless ($s1 =~ /^\s*$/ and $s2 =~ /^\s*$/)
1123 0 0 if $day =~ /^\s*(.*)\s*$/
1143 106 2727 $month_digits ? :
1148 106 2727 if ($month_digits and $dom_digits) { }
0 2727 elsif ($month_digits) { }
1786 941 elsif ($dom_digits) { }
1163 2 0 if ($use_date_language_module and not $out_str and _date_language_installed())
1169 2 0 if (defined $t)
1195 477 464 if ($in_date =~ /(^|\D)($month_str)[.]?(.*?\D)($dom_str)(.*?\D)(\d{4})($|\D)/) { }
0 464 elsif ($in_date =~ /(^|\D)($dom_str)(.+?)($month_str)[.]?(.*?\D)(\d{4})($|\D)/) { }
0 464 elsif ($in_date =~ /(^|\D)(\d{4})(\D.*?)($month_str)[.]?(.*?\D)($dom_str)($|\D)/) { }
1205 464 477 if ($allow_2_digit_years and not defined $year)
1206 464 0 if ($in_date =~ /(^|\D)($month_str)[.]?(.*?\D)($dom_str)(.*?[^:\d])(\d{2})($|[^:\d])/) { }
0 0 elsif ($in_date =~ /(^|\D)($dom_str)(.+?)($month_str)[.]?(.*?[^:\d])(\d{2})($|[^:\d])/) { }
0 0 elsif ($in_date =~ /(^|[^:\d])(\d{2})([^:\d].*?)($month_str)[.]?(.*?\D)($dom_str)($|\D)/) { }
1216 464 0 if defined $year
1219 941 0 if (defined $year)
1232 8 227 $sep =~ /\s\d{1,2}\s/ ? :
1248 76 1710 if ($in_date =~ /(^|\D)($month_str)[.]?([^\d]*?\D)($dom_num)(\D)(\d{4})($|\D)/) { }
206 1504 elsif ($in_date =~ /(^|\D)($month_str)[.]?([^\d]*?\D)($dom_num)(\D.*?\D)(\d{4})($|\D)/ and _tst_4_YY($5)) { }
21 1483 elsif ($in_date =~ /(^|\D)($dom_num)(\D*?)($month_str)[.]?(.*?\D)(\d{4})($|\D)/ and _tst_4_YY($5)) { }
636 847 elsif ($in_date =~ /(^|\D)(\d{4})(\D*?)($month_str)[.]?(.*?\D)($dom_num)($|\D)/) { }
1270 847 939 if ($allow_2_digit_years and not defined $year)
1272 182 665 if ($in_date =~ /(^|\D)($month_str)[.]?(.*?[^:\d])($dom_num)([^:\d])(\d{2})($|[^:\d])/ or $in_date =~ /(^|\D)($month_str)[.]?(.*?[^:\d])($dom_num)([^:\d].*?[^:\d])(\d{2})($|[^:\d])/) { }
9 656 elsif ($in_date =~ /(^|\D)($dom_num)([^:\d].*?)($month_str)[.]?(.*?[^:\d])($dom_num)($|[^:\d])/) { }
652 4 elsif ($in_date =~ /(^|\D)($dom_num)([^:\d].*?)($month_str)[.]?(.*?[^:\d])(\d{2})($|[^:\d])/) { }
0 4 elsif ($in_date =~ /(^|[^:\d])(\d{2})([^:\d].*?)($month_str)[.]?(.*?[^:\d])($dom_num)($|[^:\d])/) { }
1283 18 9 if $_ != 2
1299 1782 4 if (defined $year)
1319 0 0 if ($in_date =~ /(^|[^:\d])($month_num)(\D)($dom_str)(.*?\D)(\d{4})($|\D)/ or $in_date =~ /(^|[^:\d])($month_num)(\D.*?\D)($dom_str)(.*?\D)(\d{4})($|\D)/) { }
0 0 elsif ($in_date =~ /(^|\D)($dom_str)(.*?\D)($month_num)(\D)(\d{4})($|\D)/ or $in_date =~ /(^|\D)($dom_str)(.*?\D)($month_num)(\D.*?\D)(\d{4})($|\D)/) { }
0 0 elsif ($in_date =~ /(^|\D)(\d{4})(\D)($month_num)(\D)($dom_str)($|\D)/ or $in_date =~ /(^|\D)(\d{4})(\D)($month_num)(\D.*?\D)($dom_str)($|\D)/ or $in_date =~ /(^|\D)(\d{4})(\D.*?\D)($month_num)(\D)($dom_str)($|\D)/ or $in_date =~ /(^|\D)(\d{4})(\D.*?\D)($month_num)(\D.*?\D)($dom_str)($|\D)/) { }
1334 0 0 if ($allow_2_digit_years and not defined $year)
1335 0 0 if ($in_date =~ /(^|\D)($month_num)([^:\d])($dom_str)(.*?[^:\d])(\d{2})($|[^:\d])/ or $in_date =~ /(^|\D)($month_num)([^:\d].*?[^:\d])($dom_str)(.*?[^:\d])(\d{2})($|[^:\d])/) { }
0 0 elsif ($in_date =~ /(^|\D)($dom_str)(.*?[^:\d])($month_num)([^:\d])(\d{2})($|[^:\d])/ or $in_date =~ /(^|\D)($dom_str)(.*?[^:\d])($month_num)([^:\d].*?[^:\d])(\d{2})($|[^:\d])/) { }
0 0 elsif ($in_date =~ /(^|[^:\d])(\d{2})([^:\d])($month_num)([^:\d])($dom_str)($|\D)/ or $in_date =~ /(^|[^:\d])(\d{2})([^:\d])($month_num)([^:\d].*?[^:\d])($dom_str)($|\D)/ or $in_date =~ /(^|[^:\d])(\d{2})([^:\d].*?[^:\d])($month_num)([^:\d])($dom_str)($|\D)/ or $in_date =~ /(^|[^:\d])(\d{2})([^:\d].*?[^:\d])($month_num)([^:\d].*?[^:\d])($dom_str)($|\D)/) { }
1350 0 0 if defined $year
1353 0 0 if (defined $year)
1375 12 94 if ($in_date =~ /(^|\D)(\d{8})($|\D)/) { }
42 52 elsif ($in_date =~ /(^|\D)(\d{1,2})(\D+)(\d{1,2})(\D+)(\d{4})(\D|$)/) { }
21 31 elsif ($in_date =~ /(^|\D)(\d{4})(\D+)($month_num)(\D+)($dom_num)(\D|$)/) { }
1391 19 87 if ($allow_2_digit_years and not defined $year)
1393 3 16 if ($in_date =~ /(^|\D)(\d{6})($|\D)/) { }
14 2 elsif ($in_date =~ /(^|[^:\d])(\d{1,2})([^:\d]+)(\d{1,2})([^:\d]+)(\d{1,2})([^:\d]|$)/) { }
1405 92 14 if (defined $year)
1435 2817 0 if (defined $month and defined $day) { }
0 0 elsif (defined $month) { }
0 0 elsif (defined $day) { }
1445 2817 0 unless ($err_msg)
1446 2817 0 if (1 <= $day and $day <= $days_in_months[$month]) { }
0 0 elsif ($month == 2 and $day == 29) { }
1450 0 0 unless $leap
1454 0 2817 unless (defined $year)
1459 0 2817 if ($err_msg)
1477 0 216382 unless length $b <=> length $a
1481 1668 34763 if $m =~ /^\d+$/
1486 2727 32036 if ($date_str =~ /($m)/)
1488 0 2727 if $flag1
1494 106 2727 unless ($month)
1513 0 219489 unless length $b <=> length $a
1515 106 2727 $skip_period ? :
1519 62888 53788 if $dom =~ /$all_digits/
1524 50502 3286 if ($month_str) { }
0 3286 elsif ($date_str =~ /($dom)/) { }
1527 941 49561 if ($date_str =~ /$month_str.*($dom)/ or $date_str =~ /($dom).*$month_str/)
1530 48 893 if $flag1
1537 0 0 if $flag1
1543 1892 941 unless ($day)
1568 0 0 if (defined $years and $years =~ /^\d+$/)
1602 1293 31 if ($this_yr < $year and $year - $this_yr >= $global_cutoff_date)
1652 0 101 unless defined $id and $id =~ /^[123]$/
1656 12 42 if ($id == 1 and not $skip_iso and $date_str =~ /^(\d{4})(\d{2})(\d{2})$/)
1660 47 54 if ($id == 2 and $date_str =~ /^(\d{2})(\d{2})(\d{4})$/)
1664 0 101 if ($id == 3 and $date_str =~ /^(\d{2})(\d{2})(\d{4})$/)
1669 54 0 if (1 <= $m and $m <= 12 and 1 <= $d and $d <= 31)
1672 3 51 if ($m == 2)
1674 0 3 if $leap
1677 54 0 if ($d <= $max)
1729 26 0 if ($date_str =~ /^(\d{2})(\d{2})(\d{2})$/)
1732 0 29 unless defined $id and $id =~ /^[123]$/
1736 23 3 if ($id == 1 and 1 <= $part[1] and $part[1] <= 12 and 1 <= $part[2] and $part[2] <= 31)
1741 3 0 if ($id == 2 and 1 <= $part[0] and $part[0] <= 12 and 1 <= $part[1] and $part[1] <= 31)
1746 0 0 if ($id == 3 and 1 <= $part[1] and $part[1] <= 12 and 1 <= $part[0] and $part[0] <= 31)
1753 26 3 if ($m > 0)
1758 0 26 if ($m == 2)
1760 0 0 if $leap
1763 26 0 if ($d <= $max)
1820 148 0 if (defined $lang)
1823 0 148 unless ($lang_ref or $manip_ref)
1828 146 2 if (not defined $lang or lc $lang eq lc $prev_array_lang or $numbers)
1829 3 143 if ($mode == 1) { }
7 136 elsif ($mode == 2) { }
1842 0 2 if ($manip_ref)
1848 0 0 if ($u1) { }
1855 2 0 if ($lang_ref)
1863 2 0 if ($MoY_ref)
1879 2 0 if ($mode == 1) { }
0 0 elsif ($mode == 2) { }
1896 6642 19858 $leap ? :
1908 824 4 if (defined $date_str and $date_str =~ /^(\d+)-(\d+)-(\d+)$/) { }
1911 285 539 $leap ? :
1912 0 824 unless (1 <= $mon and $mon <= 12 and 1 <= $day and $day <= $days_in_months[$mon])
1963 0 184 unless (defined $end_year)
1970 96 88 if ($end_year > $start_year) { }
1973 2510 7808 $leap ? :
1980 1532 4694 $leap ? :
2012 89 92 if (defined $date_str and $date_str =~ /^[-]?\d+$/) { }
2018 0 181 unless (defined $hyd)
2045 0 89 unless (defined $target_hyd and $target_hyd =~ /^[-]?\d+$/)
2055 45 44 if ($target_hyd > 0) { }
2058 1271 3933 $leap ? :
2059 45 5159 if ($hyd_total + $days >= $target_hyd)
2064 16 29 $leap ? :
2067 45 229 if ($hyd_total + $days >= $target_hyd)
2078 782 2373 $leap ? :
2079 44 3111 if ($hyd_total - $days <= $target_hyd)
2084 17 27 $leap ? :
2087 44 248 if ($hyd_total - $days <= $target_hyd)
2093 29 15 if ($ans) { }
2 13 elsif ($_ == 1) { }
2135 0 540 unless (defined $year)
2140 192 348 $leap ? :
2148 264 276 if ($remainder_flag)
2149 96 168 $leap ? :
2180 0 96 unless (defined $year and $adj_years =~ /^[-]?\d+$/ and $adj_months =~ /^[-]?\d+$/)
2186 65 31 if ($adj_months >= 0) { }
2188 37 247 if ($month == 12) { }
2197 17 341 if ($month == 1) { }
2211 38 58 $leap ? :
2214 70 26 $day <= $d ? :