Branch Coverage

blib/lib/Test/WWW/Mechanize.pm
Criterion Covered Total %
branch 179 288 62.1


line true false branch
186 1 44 unless (defined $url)
207 51 2 if ($ok) { }
209 44 7 if ($self->is_html)
210 0 44 if ($self->autolint and $self->autotidy) { }
212 0 0 if defined $desc
223 0 44 if ($self->autolint) { }
0 44 elsif ($self->autotidy) { }
234 51 0 unless ($emitted_ok)
236 0 51 unless ($ok)
240 0 0 if $url
247 2 0 if $url
249 2 0 if $self->response
272 1 10 unless (defined $url)
282 1 9 unless ($ok)
284 1 0 if $url
286 1 0 if $self->response
315 1 0 unless (defined $url)
344 1 3 unless (defined $url)
350 2 1 unless exists $opts{'content'}
355 0 3 unless ($ok)
357 0 0 if $url
359 0 0 if $self->response
381 1 4 unless (defined $url)
387 3 1 if ($self->can('delete')) { }
407 0 1 if ref $uri eq "WWW::Mechanize::Link"
408 1 0 $self->base ? :
449 0 1 if (ref $parms ne "HASH")
489 0 2 unless (defined $desc)
491 0 0 unless defined $desc
494 0 2 if (ref $parms ne "HASH")
530 1 1 if (ref $button eq 'ARRAY') { }
537 0 2 unless ($response)
557 26 40 if (@_)
560 2 24 if (not defined $flex) { }
5 19 elsif (ref $flex eq 'HASH') { }
4 15 elsif (ref $flex eq 'ARRAY') { }
576 45 21 unless (defined $desc)
577 0 45 if ref $url eq "WWW::Mechanize::Link"
634 3 1 if (defined $actual_value) { }
682 0 0 $desc ? :
686 0 0 if ($self->is_html) { }
705 0 0 unless (eval "use $module; 1;")
710 0 0 if (ref $lint and $lint->isa('HTML::Lint')) { }
724 0 0 if ($nerrors) { }
728 0 0 $nerrors == 1 ? :
755 0 0 $desc ? :
759 0 0 if ($self->is_html) { }
779 0 0 unless (eval "use $module; 1;")
784 0 0 if (ref $tidy and $tidy->isa('HTML::Tidy5')) { }
796 0 0 if ($nmessages) { }
800 0 0 $nmessages == 1 ? :
841 1 1 unless defined $desc
859 0 1 unless defined $desc
877 0 0 unless defined $desc
895 0 0 unless defined $desc
913 0 0 unless defined $desc
931 0 0 unless defined $desc
949 0 0 unless defined $desc
967 4 3 if (ref $str)
970 1 2 unless defined $desc
987 4 3 if (ref $str)
990 1 2 unless defined $desc
1005 0 0 unless defined $desc
1049 4 3 if (ref $str)
1068 4 0 if (ref $str)
1071 0 0 unless defined $desc
1135 0 2 unless defined $desc
1152 10 14 if &$match($tagtext)
1169 1 2 unless defined $desc
1197 1 3 unless defined $desc
1201 1 3 unless (defined $usable_regex)
1233 0 3 unless defined $desc
1237 1 2 unless (defined $usable_regex)
1278 0 6 unless defined $desc
1308 1 2 unless defined $desc
1338 0 2 unless defined $desc
1370 1 3 unless (defined $usable_regex)
1377 1 2 unless defined $desc
1408 1 3 unless (defined $usable_regex)
1415 1 2 unless defined $desc
1429 0 3 $url_count == 1 ? :
1446 37 2 if ($mech->follow_link('url', $url)) { }
1447 30 7 if ($test eq 'is') { }
1448 7 23 unless $mech->status == $status
1451 1 6 if $mech->status == $status
1476 33 0 if ($mech->follow_link('url', $url)) { }
1478 18 15 if ($test eq 'like') { }
1479 6 12 unless $content =~ /$regex/
1482 6 9 if $content =~ /$regex/
1499 22 3 if (ref $links eq 'ARRAY') { }
1501 22 0 if (defined $link)
1502 21 1 if (ref $link eq 'WWW::Mechanize::Link') { }
1540 0 0 if (defined $html)
1544 0 0 if (ref $token->[1] eq "HASH")
1545 0 0 if (exists $token->[1]{$attr})
1549 0 0 ref $value eq 'Regexp' ? :
1550 0 0 if ($matched)
1553 0 0 unless (wantarray)
1562 0 0 unless wantarray
1585 28 0 if (defined $html)
1588 24 4 if ($found >= 0)
1592 125 65 if (ref $token->[1] eq "HASH")
1594 98 27 unless defined $actual_id
1595 25 100 if ($actual_id eq $id)
1598 19 6 unless (wantarray)
1607 22 6 unless wantarray
1616 0 28 if (@_) { }
1621 28 0 if ($self->is_html)
1644 10 1 if (defined $got) { }
1670 4 1 if (defined $got) { }
1698 2 26 unless ($self->{'ids'})
1706 4 6 if (my $id = $attr->{'id'})
1757 1 3 if defined $msg
1809 1 3 if defined $msg
1818 9 0 defined $id ? :
1906 40 88 if (@_)
1938 40 44 if (@_)
1976 6 0 if ($form)
2011 0 6 if (not %{$patterns;}) { }
2021 12 14 unless exists $hash->{$pattern_key} and $hash->{$pattern_key} =~ /$patterns->{$pattern_key}/
2022 12 14 unless $matches_everything
2025 11 12 if $matches_everything
2097 3 4 if (defined $options->{'fill'} and length $options->{'fill'} > 0)
2103 1 6 if (exists $options->{'ignore'})
2109 2 5 if (exists $options->{'specs'})
2121 0 42 if $field->readonly
2122 0 42 if $field->disabled
2127 1 41 if exists $ignore->{$name}
2133 34 7 if ($field->type ne "textarea")
2134 27 7 if (exists $field->{'maxlength'})
2142 4 37 if (exists $specs->{$name})
2145 3 0 if (exists $specs->{$name}{'fill'} and defined $specs->{$name}{'fill'} and length $specs->{$name}{'fill'} > 0)
2150 2 2 if (exists $specs->{$name}{'maxlength'} and defined $specs->{$name}{'maxlength'})
2157 38 3 if ($maxlength % length($fill) == 0) { }
2203 0 2 unless defined $comment
2211 0 9 if $field->readonly
2212 2 7 if $field->disabled
2214 1 6 unless (defined $field->{'maxlength'})
2220 4 2 if (not $val =~ /^\s*\d+\s*$/ or $val + 0 <= 0)
2261 0 0 if (@args % 2)
2265 0 0 unless defined $comment
2274 0 0 unless ($head_cache->{$abs}++)
2278 0 0 unless ($res->is_success)
2296 3 0 $uri ? :