Condition Coverage

blib/lib/WWW/Mechanize.pm
Criterion Covered Total %
condition 227 264 85.9


and 3 conditions

line !l l&&!r l&&r condition
227 1 2 25 $stack and @{$stack;}
253 1 0 14 $self->{'req'} and $self->{'res'}
267 1 0 9 $self->{'req'} and $self->{'res'}
274 0 1 0 $stack and @$stack >= $n
283 1 3 56 $self->res && $self->res->is_success
301 5 348 0 defined $self->ct && ($self->ct eq 'text/html' || $self->ct eq 'application/xhtml+xml')
471 475 3 93 defined $p->{'url'} and not $link->url eq $p->{'url'}
472 405 10 63 defined $p->{'url_regex'} and not $link->url =~ /$p->{'url_regex'}/
473 389 0 26 defined $p->{'url_abs'} and not $link->url_abs eq $p->{'url_abs'}
476 364 1 24 defined $p->{'url_abs_regex'} and not $link->url_abs =~ /$p->{'url_abs_regex'}/
479 28 39 8 defined $link->text && $link->text eq $p->{'text'}
290 8 67 defined $p->{'text'} and not defined $link->text && $link->text eq $p->{'text'}
482 54 91 20 defined $link->text && $link->text =~ /$p->{'text_regex'}/
133 20 145 defined $p->{'text_regex'} and not defined $link->text && $link->text =~ /$p->{'text_regex'}/
485 9 0 1 defined $link->name && $link->name eq $p->{'name'}
143 1 9 defined $p->{'name'} and not defined $link->name && $link->name eq $p->{'name'}
488 13 2 2 defined $link->name && $link->name =~ /$p->{'name_regex'}/
127 2 15 defined $p->{'name_regex'} and not defined $link->name && $link->name =~ /$p->{'name_regex'}/
489 0 4 8 $link->tag && $link->tag eq $p->{'tag'}
117 8 4 defined $p->{'tag'} and not $link->tag && $link->tag eq $p->{'tag'}
492 0 4 7 $link->tag && $link->tag =~ /$p->{'tag_regex'}/
114 7 4 defined $p->{'tag_regex'} and not $link->tag && $link->tag =~ /$p->{'tag_regex'}/
496 3 0 1 $link->attrs->{'id'} && $link->attrs->{'id'} eq $p->{'id'}
117 1 3 defined $p->{'id'} and not $link->attrs->{'id'} && $link->attrs->{'id'} eq $p->{'id'}
499 3 0 1 $link->attrs->{'id'} && $link->attrs->{'id'} =~ /$p->{'id_regex'}/
114 1 3 defined $p->{'id_regex'} and not $link->attrs->{'id'} && $link->attrs->{'id'} =~ /$p->{'id_regex'}/
502 1 0 1 $link->attrs->{'class'} && $link->attrs->{'class'} eq $p->{'class'}
113 1 1 defined $p->{'class'} and not $link->attrs->{'class'} && $link->attrs->{'class'} eq $p->{'class'}
506 1 0 1 $link->attrs->{'class'} && $link->attrs->{'class'} =~ /$p->{'class_regex'}/
112 1 1 defined $p->{'class_regex'} and not $link->attrs->{'class'} && $link->attrs->{'class'} =~ /$p->{'class_regex'}/
510 2 1 1 $link->attrs->{'rel'} && $link->attrs->{'rel'} eq $p->{'rel'}
109 1 3 defined $p->{'rel'} and not $link->attrs->{'rel'} && $link->attrs->{'rel'} eq $p->{'rel'}
513 2 0 1 $link->attrs->{'rel'} && $link->attrs->{'rel'} =~ /$p->{'rel_regex'}/
107 1 2 defined $p->{'rel_regex'} and not $link->attrs->{'rel'} && $link->attrs->{'rel'} =~ /$p->{'rel_regex'}/
587 0 11 11 defined $what && ($is_regex ? $what =~ /$criteria{$criterion}/ : $what eq $criteria{$criterion})
660 3 39 11 defined $image->url && $image->url eq $p->{'url'}
376 11 42 defined $p->{'url'} and not defined $image->url && $image->url eq $p->{'url'}
663 3 30 4 defined $image->url && $image->url =~ /$p->{'url_regex'}/
350 4 33 defined $p->{'url_regex'} and not defined $image->url && $image->url =~ /$p->{'url_regex'}/
667 0 30 2 defined $image->url_abs && $image->url_abs eq $p->{'url_abs'}
322 2 30 defined $p->{'url_abs'} and not defined $image->url_abs && $image->url_abs eq $p->{'url_abs'}
671 0 25 4 defined $image->url_abs && $image->url_abs =~ /$p->{'url_abs_regex'}/
295 4 25 defined $p->{'url_abs_regex'} and not defined $image->url_abs && $image->url_abs =~ /$p->{'url_abs_regex'}/
674 23 1 2 defined $image->alt && $image->alt eq $p->{'alt'}
273 2 24 defined $p->{'alt'} and not defined $image->alt && $image->alt eq $p->{'alt'}
677 23 1 2 defined $image->alt && $image->alt =~ /$p->{'alt_regex'}/
249 2 24 defined $p->{'alt_regex'} and not defined $image->alt && $image->alt =~ /$p->{'alt_regex'}/
679 0 39 15 $image->tag && $image->tag eq $p->{'tag'}
197 15 39 defined $p->{'tag'} and not $image->tag && $image->tag eq $p->{'tag'}
682 0 16 10 $image->tag && $image->tag =~ /$p->{'tag_regex'}/
186 10 16 defined $p->{'tag_regex'} and not $image->tag && $image->tag =~ /$p->{'tag_regex'}/
687 13 7 2 $image->attrs && $image->attrs->{'id'} && $image->attrs->{'id'} eq $p->{'id'}
167 2 27 defined $p->{'id'} and not $image->attrs && $image->attrs->{'id'} && $image->attrs->{'id'} eq $p->{'id'}
692 13 6 3 $image->attrs && $image->attrs->{'id'} && $image->attrs->{'id'} =~ /$p->{'id_regex'}/
140 3 26 defined $p->{'id_regex'} and not $image->attrs && $image->attrs->{'id'} && $image->attrs->{'id'} =~ /$p->{'id_regex'}/
697 15 5 2 $image->attrs && $image->attrs->{'class'} && $image->attrs->{'class'} eq $p->{'class'}
114 2 27 defined $p->{'class'} and not $image->attrs && $image->attrs->{'class'} && $image->attrs->{'class'} eq $p->{'class'}
702 15 7 6 $image->attrs && $image->attrs->{'class'} && $image->attrs->{'class'} =~ /$p->{'class_regex'}/
81 6 29 defined $p->{'class_regex'} and not $image->attrs && $image->attrs->{'class'} && $image->attrs->{'class'} =~ /$p->{'class_regex'}/
809 3 4 3 @fields > 1 and ref $fields[-1] eq "HASH"
857 13 0 7 @args % 2 and ref $args[-1] eq "HASH"
905 54 143 60 defined $y && $x eq $y
978 0 0 2 not ref $n and $n =~ /^\d+$/
1031 0 4 3 $input->type eq "file" and ref $value->[0] eq "ARRAY"
1222 0 6 3 $input->value and $args{'value'} eq $input->value
1404 0 0 1 length $binmode and substr($binmode, 0, 1) eq ":"
1556 1 3 4 @_ == 2 and $_[0] =~ /:\d+$/
1888 151 3 3 $onClick and $onClick =~ /^window\.open\(\s*'([^']+)'/
3 148 3 $url and $url =~ /^javascript\:\s*(?:void\(\s*)?window\.open\(\s*'([^']+)'/s
1908 3 7 7 $equiv and lc $equiv eq "refresh"
10 0 7 $equiv and lc $equiv eq "refresh" and defined $content
1963 55 0 121 $req and $res
55 3 118 $req and $res and $self->stack_depth

or 2 conditions

line l !l condition
911 30 19 $number ||= 1
1145 1 15 shift() || 1
1327 0 0 $args{'x'} || 0
0 0 $args{'y'} || 0
1402 1 1 delete $opts{'binmode'} || ''
1421 2 1 shift() || ''
1446 1 1 shift() || \*STDOUT
1460 1 1 shift() || \*STDOUT
1474 2 2 shift() || \*STDOUT
1485 1 1 shift() || \*STDOUT
1591 191 12 $res->content_type || ''
1966 117 1 $self->{'page_stack'} ||= []

or 3 conditions

line l !l&&r !l&&!r condition
345 1 1 0 delete $params{'base_href'} || $self->base
776 3 5 0 $args || ()
782 3 3 0 $args || ()
1031 1 3 4 $input->type ne "file" or $input->type eq "file" and ref $value->[0] eq "ARRAY"
1402 1 0 1 my $binmode = delete $opts{'binmode'} || '' or not $self->content_type =~ m[^text/]
1528 160 13 2 $request->method eq "GET" or $request->method eq "POST"
1556 0 4 4 @_ == 4 or @_ == 2 and $_[0] =~ /:\d+$/