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
213 1 2 24 $stack and @{$stack;}
239 1 0 14 $self->{'req'} and $self->{'res'}
253 1 0 9 $self->{'req'} and $self->{'res'}
260 0 1 0 $stack and @$stack >= $n
269 1 3 56 $self->res && $self->res->is_success
287 5 346 0 defined $self->ct && ($self->ct eq 'text/html' || $self->ct eq 'application/xhtml+xml')
453 474 3 93 defined $p->{'url'} and not $link->url eq $p->{'url'}
454 404 10 63 defined $p->{'url_regex'} and not $link->url =~ /$p->{'url_regex'}/
455 388 0 26 defined $p->{'url_abs'} and not $link->url_abs eq $p->{'url_abs'}
456 363 1 24 defined $p->{'url_abs_regex'} and not $link->url_abs =~ /$p->{'url_abs_regex'}/
457 28 39 8 defined $link->text && $link->text eq $p->{'text'}
289 8 67 defined $p->{'text'} and not defined $link->text && $link->text eq $p->{'text'}
458 54 91 20 defined $link->text && $link->text =~ /$p->{'text_regex'}/
132 20 145 defined $p->{'text_regex'} and not defined $link->text && $link->text =~ /$p->{'text_regex'}/
459 9 0 1 defined $link->name && $link->name eq $p->{'name'}
142 1 9 defined $p->{'name'} and not defined $link->name && $link->name eq $p->{'name'}
460 13 2 2 defined $link->name && $link->name =~ /$p->{'name_regex'}/
126 2 15 defined $p->{'name_regex'} and not defined $link->name && $link->name =~ /$p->{'name_regex'}/
461 0 4 8 $link->tag && $link->tag eq $p->{'tag'}
116 8 4 defined $p->{'tag'} and not $link->tag && $link->tag eq $p->{'tag'}
462 0 4 7 $link->tag && $link->tag =~ /$p->{'tag_regex'}/
113 7 4 defined $p->{'tag_regex'} and not $link->tag && $link->tag =~ /$p->{'tag_regex'}/
464 3 0 1 $link->attrs->{'id'} && $link->attrs->{'id'} eq $p->{'id'}
116 1 3 defined $p->{'id'} and not $link->attrs->{'id'} && $link->attrs->{'id'} eq $p->{'id'}
465 3 0 1 $link->attrs->{'id'} && $link->attrs->{'id'} =~ /$p->{'id_regex'}/
113 1 3 defined $p->{'id_regex'} and not $link->attrs->{'id'} && $link->attrs->{'id'} =~ /$p->{'id_regex'}/
466 1 0 1 $link->attrs->{'class'} && $link->attrs->{'class'} eq $p->{'class'}
112 1 1 defined $p->{'class'} and not $link->attrs->{'class'} && $link->attrs->{'class'} eq $p->{'class'}
467 1 0 1 $link->attrs->{'class'} && $link->attrs->{'class'} =~ /$p->{'class_regex'}/
111 1 1 defined $p->{'class_regex'} and not $link->attrs->{'class'} && $link->attrs->{'class'} =~ /$p->{'class_regex'}/
469 2 1 1 $link->attrs->{'rel'} && $link->attrs->{'rel'} eq $p->{'rel'}
108 1 3 defined $p->{'rel'} and not $link->attrs->{'rel'} && $link->attrs->{'rel'} eq $p->{'rel'}
470 2 0 1 $link->attrs->{'rel'} && $link->attrs->{'rel'} =~ /$p->{'rel_regex'}/
106 1 2 defined $p->{'rel_regex'} and not $link->attrs->{'rel'} && $link->attrs->{'rel'} =~ /$p->{'rel_regex'}/
542 0 11 11 defined $what && ($is_regex ? $what =~ /$criteria{$criterion}/ : $what eq $criteria{$criterion})
611 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'}
612 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'}/
613 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'}
614 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'}/
615 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'}
616 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'}/
617 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'}
618 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'}/
619 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'}
620 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'}/
621 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'}
622 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'}/
727 3 4 3 @fields > 1 and ref $fields[-1] eq "HASH"
770 13 0 7 @args % 2 and ref $args[-1] eq "HASH"
817 53 141 57 defined $y && $x eq $y
890 0 0 2 not ref $n and $n =~ /^\d+$/
941 0 4 3 $input->type eq "file" and ref $value->[0] eq "ARRAY"
1119 0 6 3 $input->value and $args{'value'} eq $input->value
1294 0 0 1 length $binmode and substr($binmode, 0, 1) eq ":"
1445 1 3 4 @_ == 2 and $_[0] =~ /:\d+$/
1764 141 3 3 $onClick and $onClick =~ /^window\.open\(\s*'([^']+)'/
3 138 3 $url and $url =~ /^javascript\:\s*(?:void\(\s*)?window\.open\(\s*'([^']+)'/s
1781 3 7 7 $equiv and lc $equiv eq "refresh"
10 0 7 $equiv and lc $equiv eq "refresh" and defined $content
1835 55 0 120 $req and $res
55 3 117 $req and $res and $self->stack_depth

or 2 conditions

line l !l condition
824 30 19 $number ||= 1
1048 1 15 shift() || 1
1218 0 0 $args{'x'} || 0
0 0 $args{'y'} || 0
1293 1 1 delete $opts{'binmode'} || ''
1311 2 1 shift() || ''
1335 1 1 shift() || \*STDOUT
1349 1 1 shift() || \*STDOUT
1363 2 2 shift() || \*STDOUT
1374 1 1 shift() || \*STDOUT
1480 189 12 $res->content_type || ''
1838 116 1 $self->{'page_stack'} ||= []

or 3 conditions

line l !l&&r !l&&!r condition
330 1 1 0 delete $params{'base_href'} || $self->base
692 3 5 0 $args || ()
698 3 3 0 $args || ()
941 1 3 4 $input->type ne "file" or $input->type eq "file" and ref $value->[0] eq "ARRAY"
1293 1 0 1 my $binmode = delete $opts{'binmode'} || '' or not $self->content_type =~ m[^text/]
1420 159 13 2 $request->method eq "GET" or $request->method eq "POST"
1445 0 4 4 @_ == 4 or @_ == 2 and $_[0] =~ /:\d+$/