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
222 1 2 25 $stack and @{$stack;}
248 1 0 14 $self->{'req'} and $self->{'res'}
262 1 0 9 $self->{'req'} and $self->{'res'}
269 0 1 0 $stack and @$stack >= $n
278 1 3 56 $self->res && $self->res->is_success
296 5 348 0 defined $self->ct && ($self->ct eq 'text/html' || $self->ct eq 'application/xhtml+xml')
462 475 3 93 defined $p->{'url'} and not $link->url eq $p->{'url'}
463 405 10 63 defined $p->{'url_regex'} and not $link->url =~ /$p->{'url_regex'}/
464 389 0 26 defined $p->{'url_abs'} and not $link->url_abs eq $p->{'url_abs'}
465 364 1 24 defined $p->{'url_abs_regex'} and not $link->url_abs =~ /$p->{'url_abs_regex'}/
466 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'}
467 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'}/
468 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'}
469 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'}/
470 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'}
471 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'}/
473 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'}
474 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'}/
475 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'}
476 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'}/
478 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'}
479 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'}/
551 0 11 11 defined $what && ($is_regex ? $what =~ /$criteria{$criterion}/ : $what eq $criteria{$criterion})
620 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'}
621 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'}/
622 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'}
623 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'}/
624 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'}
625 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'}/
626 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'}
627 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'}/
628 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'}
629 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'}/
630 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'}
631 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'}/
736 3 4 3 @fields > 1 and ref $fields[-1] eq "HASH"
779 13 0 7 @args % 2 and ref $args[-1] eq "HASH"
826 54 143 60 defined $y && $x eq $y
899 0 0 2 not ref $n and $n =~ /^\d+$/
950 0 4 3 $input->type eq "file" and ref $value->[0] eq "ARRAY"
1128 0 6 3 $input->value and $args{'value'} eq $input->value
1303 0 0 1 length $binmode and substr($binmode, 0, 1) eq ":"
1454 1 3 4 @_ == 2 and $_[0] =~ /:\d+$/
1773 151 3 3 $onClick and $onClick =~ /^window\.open\(\s*'([^']+)'/
3 148 3 $url and $url =~ /^javascript\:\s*(?:void\(\s*)?window\.open\(\s*'([^']+)'/s
1790 3 7 7 $equiv and lc $equiv eq "refresh"
10 0 7 $equiv and lc $equiv eq "refresh" and defined $content
1844 55 0 121 $req and $res
55 3 118 $req and $res and $self->stack_depth

or 2 conditions

line l !l condition
833 30 19 $number ||= 1
1057 1 15 shift() || 1
1227 0 0 $args{'x'} || 0
0 0 $args{'y'} || 0
1302 1 1 delete $opts{'binmode'} || ''
1320 2 1 shift() || ''
1344 1 1 shift() || \*STDOUT
1358 1 1 shift() || \*STDOUT
1372 2 2 shift() || \*STDOUT
1383 1 1 shift() || \*STDOUT
1489 191 12 $res->content_type || ''
1847 117 1 $self->{'page_stack'} ||= []

or 3 conditions

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