Branch Coverage

blib/lib/DateTime/Format/Text.pm
Criterion Covered Total %
branch 53 70 75.7


line true false branch
80 1 19 if (not defined $class) { }
0 19 elsif (ref $class) { }
103 8 36 if (not ref $self) { }
1 35 elsif (ref $self eq 'HASH') { }
0 35 elsif (ref $_[0]) { }
104 7 1 if (scalar @_)
132 5 142 if (not ref $self) { }
1 141 elsif (ref $self eq 'HASH') { }
5 136 elsif (ref $_[0] eq 'HASH') { }
0 136 elsif (ref $_[0]) { }
4 132 elsif (scalar @_ and scalar(@_) % 2 == 0) { }
133 4 1 if (scalar @_) { }
0 1 elsif ($self eq 'DateTime::Format::Text') { }
152 141 0 if (my $string = $params{'string'}) { }
154 0 141 if (ref $string)
158 61 80 if (wantarray)
178 60 1 if (scalar @rc)
190 16 65 if ($string =~ m[(^|\D)([0-9]?[0-9])[\.\-/ ]+?([0-1]?[0-9])[\.\-/ ]+?([0-9]{2,4})]) { }
0 65 elsif ($string =~ m[($d|$sd)[\s,\-_/]*?(\d?\d)[,\-/]*($o)?[\s,\-/]*($m|$sm)[\s,\-/]+(\d{4})]i) { }
12 53 elsif ($string =~ m[($m|$sm)[\s,\-_/]*?(\d?\d)[,\-/]*($o)?[\s,\-/]+(\d{4})]i) { }
211 53 28 unless (defined $month)
213 53 0 if ($string =~ /($m|$sm)/i)
218 53 28 unless (defined $year)
220 53 0 if ($string =~ /(\d{4})/)
226 53 28 if (defined $month and defined $year and not defined $day)
228 0 53 if ($string =~ m[($d|$sd)[,\s\-/]+(\d?\d)[,\-/]*($o)\s+$year]i) { }
0 53 elsif ($string =~ /[\s\(](\d{1,2})\s+($m|$sm)/i) { }
52 1 elsif ($string =~ /^(\d{1,2})\s+($m|$sm)\s/i) { }
1 0 elsif ($string =~ /\s(\d{1,2})th\s/) { }
0 0 elsif ($string =~ /\s1st\s/i) { }
0 0 elsif ($string =~ /\s2nd\s/i) { }
243 81 0 if ($day and $month and $year)
244 16 65 if ($year < 100)
248 65 16 if ($month =~ /[a-z]/i) { }
250 65 163 if ($month eq $month_names[$i] or $month eq $short_month_names[$i])