Branch Coverage

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


line true false branch
80 1 18 if (not defined $class) { }
0 18 elsif (ref $class) { }
103 7 36 if (not ref $self) { }
1 35 elsif (ref $self eq 'HASH') { }
0 35 elsif (ref $_[0]) { }
104 6 1 if (scalar @_)
132 5 139 if (not ref $self) { }
1 138 elsif (ref $self eq 'HASH') { }
5 133 elsif (ref $_[0] eq 'HASH') { }
0 133 elsif (ref $_[0]) { }
4 129 elsif (scalar @_ and scalar(@_) % 2 == 0) { }
133 4 1 if (scalar @_) { }
0 1 elsif ($self eq 'DateTime::Format::Text') { }
152 138 0 if (my $string = $params{'string'}) { }
154 0 138 if (ref $string)
158 60 78 if (wantarray)
178 59 1 if (scalar @rc)
190 16 63 if ($string =~ m[([0-9]?[0-9])[\.\-/ ]+?([0-1]?[0-9])[\.\-/ ]+?([0-9]{2,4})]) { }
0 63 elsif ($string =~ m[($d|$sd)[\s,\-_/]*?(\d?\d)[,\-/]*($o)?[\s,\-/]*($m|$sm)[\s,\-/]+(\d{4})]i) { }
12 51 elsif ($string =~ m[($m|$sm)[\s,\-_/]*?(\d?\d)[,\-/]*($o)?[\s,\-/]+(\d{4})]i) { }
211 51 28 unless (defined $month)
213 51 0 if ($string =~ /($m|$sm)/i)
218 51 28 unless (defined $year)
220 51 0 if ($string =~ /(\d{4})/)
226 51 28 if (defined $month and defined $year and not defined $day)
228 0 51 if ($string =~ m[($d|$sd)[,\s\-/]+(\d?\d)[,\-/]*($o)\s+$year]i) { }
0 51 elsif ($string =~ /[\s\(](\d{1,2})\s+($m|$sm)/i) { }
50 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 79 0 if ($day and $month and $year)
244 16 63 if ($year < 100)
248 63 16 if ($month =~ /[a-z]/i) { }
250 63 155 if ($month eq $month_names[$i] or $month eq $short_month_names[$i])