Branch Coverage

blib/lib/WebService/IMDB/Date.pm
Criterion Covered Total %
branch 17 30 56.6


line true false branch
30 0 97 unless my $data = shift()
32 75 22 if (ref $data eq 'HASH' and exists $$data{'normal'} and defined $$data{'normal'}) { }
1 21 elsif (ref $data eq 'HASH' and exists $$data{'text'}) { }
21 0 elsif (ref $data eq '' and $data =~ /^\d{4}-\d{2}-\d{2}$/) { }
35 0 75 unless my($y, $m, $d) = $dt =~ /^(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?$/
36 68 7 if (defined $y and defined $m and defined $d) { }
2 5 elsif (defined $y and defined $m) { }
5 0 elsif (defined $y) { }
48 0 1 if (not defined $$data{'text'}) { }
54 0 1 if (defined $d) { }
0 1 elsif ($$data{'text'} =~ m[^\d{1,2}/\d{2}$]) { }
0 1 elsif ($$data{'text'} =~ m[^\d{1,2}/\d{1,2}/\d{2}$]) { }
58 0 0 unless my($m, $y) = $$data{'text'} =~ m[^(\d{1,2})/(\d{2})$]
62 0 0 unless my($m, $d, $y) = $$data{'text'} =~ m[^(\d{1,2})/(\d{1,2})/(\d{2})$]
71 0 21 unless my($y, $m, $d) = $data =~ /^(\d{4})-(\d{2})-(\d{2})$/