Branch Coverage

blib/lib/Date/Parse.pm
Criterion Covered Total %
branch 113 198 57.0


line true false branch
216 5 4 if ($Date::Parse::obj)
222 0 5 unless my $sub = eval "$obj_strptime"
0 2 if @_
0 2 unless $dtstr =~ /\S/
0 2 if ($dtstr =~ s/\s(\d{4})([-:]?)(\d\d?)\2(\d\d?)(?:[-Tt ](\d\d?)(?:([-:]?)(\d\d?)(?:\6(\d\d?)(?:[.,](\d+))?)?)?)?(?=\D)/ /)
0 1 if $5
0 1 if $6
1 1 if ($dtstr =~ s/[:\s](\d\d?):(\d\d?)(:(\d\d?)(?:\.\d+)?)?(z)?\s*(?:([ap])\.?m?\.?)?\s/ /o) { }
0 1 elsif ($dtstr =~ s/\s(\d\d?)\s*([ap])\.?m?\.?\s/ /o) { }
2 0 unless (defined $hh)
0 1 if (defined $hh and $hh <= 12 and $dtstr =~ s/ ([ap])\.?m?\.?\s/ /o)
0 0 if $5
0 0 if $month > 12
0 0 if length $year > 2 and $year < 1901
0 0 if ($5)
0 2 if ($dtstr =~ s[\s(\d\d?)([\-\./])($monpat)(\2(\d\d+))?\s][ ]o) { }
0 2 elsif ($dtstr =~ s[\s(\d+)([\-\./])(\d\d?)(\2(\d+))?\s][ ]o) { }
1 1 elsif ($dtstr =~ s/\s(\d+)\s*($sufpat)?\s*($monpat)/ /o) { }
1 0 elsif ($dtstr =~ s/($monpat)\s*(\d+)\s*($sufpat)?\s/ /o) { }
0 0 elsif ($dtstr =~ s[($monpat)([\/-])(\d+)[\/-]][ ]o) { }
0 0 elsif ($dtstr =~ s/\s(\d\d)(\d\d)(\d\d)\s/ /o) { }
2 0 if not defined $year and $dtstr =~ s/\s(\d{2}(\d{2})?)[\s\.,]/ /o
2 0 unless (defined $year)
0 2 if $dtstr =~ s/\bdst\b//o
0 0 if $2 and $2 eq 'dst'
0 0 unless defined $zone
0 0 defined $4 ? :
0 0 defined $1 ? :
0 0 unless defined $zone
0 2 if ($dtstr =~ s/\s"?([a-z]{3,4})(dst|\d+[a-z]*|_[a-z]+)?"?\s/ /o) { }
0 2 elsif ($dtstr =~ s/\s([a-z]{3,4})?([\-\+]?)-?(\d\d?):?(\d\d)?(00)?\s/ /o) { }
0 0 defined $4 ? :
0 0 defined $1 ? :
0 0 unless defined $zone
0 0 if ($dtstr =~ s/^\s*(ut?|z)\s*$//) { }
0 0 elsif ($dtstr =~ s/\s([a-z]{3,4})?([\-\+]?)-?(\d\d?)(\d\d)?(00)?\s/ /o) { }
0 0 if $dtstr =~ /\S/o
0 2 if ($dtstr =~ /\S/)
0 0 if $merid == $AM
0 1 if ($hh == 12) { }
0 1 elsif ($merid == $PM) { }
1 1 if (defined $hh)
2 0 if (defined $year and $year > 1900)
0 2 if defined $zone and $dst
0 2 if $frac
226 0 4 unless eval "$strptime"
0 446 if @_
1 445 unless $dtstr =~ /\S/
42 403 if ($dtstr =~ s/\s(\d{4})([-:]?)(\d\d?)\2(\d\d?)(?:[-Tt ](\d\d?)(?:([-:]?)(\d\d?)(?:\6(\d\d?)(?:[.,](\d+))?)?)?)?(?=\D)/ /)
1 401 if $5
7 395 if $6
402 8 if ($dtstr =~ s/[:\s](\d\d?):(\d\d?)(:(\d\d?)(?:\.\d+)?)?(z)?\s*(?:([ap])\.?m?\.?)?\s/ /o) { }
0 8 elsif ($dtstr =~ s/\s(\d\d?)\s*([ap])\.?m?\.?\s/ /o) { }
410 35 unless (defined $hh)
2 435 if (defined $hh and $hh <= 12 and $dtstr =~ s/ ([ap])\.?m?\.?\s/ /o)
2 2 if $5
4 0 if $month > 12
0 4 if length $year > 2 and $year < 1901
4 0 if ($5)
4 399 if ($dtstr =~ s[\s(\d\d?)([\-\./])($monpat)(\2(\d\d+))?\s][ ]o) { }
4 395 elsif ($dtstr =~ s[\s(\d+)([\-\./])(\d\d?)(\2(\d+))?\s][ ]o) { }
222 173 elsif ($dtstr =~ s/\s(\d+)\s*($sufpat)?\s*($monpat)/ /o) { }
161 12 elsif ($dtstr =~ s/($monpat)\s*(\d+)\s*($sufpat)?\s/ /o) { }
6 6 elsif ($dtstr =~ s[($monpat)([\/-])(\d+)[\/-]][ ]o) { }
0 6 elsif ($dtstr =~ s/\s(\d\d)(\d\d)(\d\d)\s/ /o) { }
389 14 if not defined $year and $dtstr =~ s/\s(\d{2}(\d{2})?)[\s\.,]/ /o
403 42 unless (defined $year)
0 445 if $dtstr =~ s/\bdst\b//o
0 281 if $2 and $2 eq 'dst'
0 281 unless defined $zone
130 0 defined $4 ? :
0 130 defined $1 ? :
0 130 unless defined $zone
281 164 if ($dtstr =~ s/\s"?([a-z]{3,4})(dst|\d+[a-z]*|_[a-z]+)?"?\s/ /o) { }
130 34 elsif ($dtstr =~ s/\s([a-z]{3,4})?([\-\+]?)-?(\d\d?):?(\d\d)?(00)?\s/ /o) { }
0 0 defined $4 ? :
0 0 defined $1 ? :
0 0 unless defined $zone
11 0 if ($dtstr =~ s/^\s*(ut?|z)\s*$//) { }
0 0 elsif ($dtstr =~ s/\s([a-z]{3,4})?([\-\+]?)-?(\d\d?)(\d\d)?(00)?\s/ /o) { }
0 11 if $dtstr =~ /\S/o
11 434 if ($dtstr =~ /\S/)
1 19 if $merid == $AM
20 417 if ($hh == 12) { }
7 410 elsif ($merid == $PM) { }
437 8 if (defined $hh)
289 156 if (defined $year and $year > 1900)
0 445 if defined $zone and $dst
3 442 if $frac
237 1 443 unless @t
249 6 437 unless defined $month
252 6 437 unless defined $day
255 3 6 $month > $lt[4] ? :
8 435 unless defined $year
259 287 156 if defined $century
262 0 442 unless $month <= 11 and $day >= 1 and $day <= 31 and $hh <= 23 and $mm <= 59 and $ss <= 59
267 421 21 if (defined $zone) { }
273 1 421 if not defined $result or $result == -1 and join('', $ss, $mm, $hh, $day, $month, $year) ne '595923311169'
285 0 22 if not defined $result or $result == -1 and join('', $ss, $mm, $hh, $day, $month, $year) ne join('', (localtime -1)[0..5])