Branch Coverage

blib/lib/WWW/Scrape/FindaGrave.pm
Criterion Covered Total %
branch 31 52 59.6


line true false branch
59 0 3 unless defined $class
61 3 0 ref $_[0] eq 'HASH' ? :
63 0 3 unless $args{'firstname'}
64 0 3 unless $args{'lastname'}
66 0 1 unless $args{'date_of_death'} or $args{'date_of_birth'}
79 0 3 unless ($resp->is_success)
90 2 1 if ($rc->{'date_of_death'}) { }
1 0 elsif ($rc->{'date_of_birth'}) { }
98 0 3 if ($rc->{'middlename'})
111 2 1 if ($rc->{'country'})
112 0 2 if ($rc->{'country'} eq 'United States') { }
123 0 3 unless ($resp->is_success)
126 1 2 if ($resp->content =~ /Sorry, there are no records in the Find A Grave database matching your query\./)
130 2 0 if ($resp->content =~ m[(\d+)\s+total matches]im)
132 0 2 if $rc->{'matches'} == 0
161 1 3 if $self->{'matches'} == 0
164 0 3 if $rc
166 2 1 if $self->{'index'} >= $self->{'matches'}
180 29 0 if ($date_of_death) { }
0 0 elsif (defined $date_of_birth) { }
181 1 28 if ($link =~ m[www.findagrave.com/cgi-bin/fg.cgi\?.*&GSln=\Q$lastname\E.*&GSfn=\Q$firstname\E.*&GSdy=\Q$date_of_death\E.*&GRid=\d+]i)
185 0 0 if ($link =~ m[www.findagrave.com/cgi-bin/fg.cgi\?.*&GSln=\Q$lastname\E.*&GSfn=\Q$firstname\E.*&GSby=\Q$date_of_birth\E.*&GRid=\d+]i)
189 1 0 if ($match and $self->{'country'})
191 0 1 unless ($self->{'resp'}->content =~ /\Q$country\E/i)
195 1 28 if ($match)
200 1 0 if ($self->{'index'} <= $self->{'matches'})