Condition Coverage

blib/lib/WWW/Mechanize.pm
Criterion Covered Total %
condition 229 266 86.0


and 3 conditions

line !l l&&!r l&&r condition
226 1 2 26 $stack and @{$stack;}
252 1 0 14 $self->{'req'} and $self->{'res'}
266 1 0 9 $self->{'req'} and $self->{'res'}
273 0 1 0 $stack and @$stack >= $n
282 1 3 56 $self->res && $self->res->is_success
300 5 353 0 defined $self->ct && ($self->ct eq 'text/html' || $self->ct eq 'application/xhtml+xml')
471 484 3 93 defined $p->{'url'} and not $link->url eq $p->{'url'}
472 414 10 63 defined $p->{'url_regex'} and not $link->url =~ /$p->{'url_regex'}/
473 398 0 26 defined $p->{'url_abs'} and not $link->url_abs eq $p->{'url_abs'}
476 373 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'}
299 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'}/
142 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'}
152 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'}/
136 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'}
126 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'}/
123 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'}
126 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'}/
123 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'}
122 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'}/
121 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'}
118 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'}/
116 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'}/
810 3 4 3 @fields > 1 and ref $fields[-1] eq "HASH"
858 13 0 7 @args % 2 and ref $args[-1] eq "HASH"
906 54 143 60 defined $y && $x eq $y
980 0 0 2 not ref $n and $n =~ /^\d+$/
1033 0 4 3 $input->type eq "file" and ref $value->[0] eq "ARRAY"
1225 0 6 3 $input->value and $args{'value'} eq $input->value
1407 0 0 1 length $binmode and substr($binmode, 0, 1) eq ":"
1558 1 3 4 @_ == 2 and $_[0] =~ /:\d+$/
1856 172 3 3 $onClick and $onClick =~ /^window\.open\(\s*'([^']+)'/
3 169 3 $url and $url =~ /^javascript\:\s*(?:void\(\s*)?window\.open\(\s*'([^']+)'/s
1876 3 8 7 $equiv and lc $equiv eq "refresh"
11 0 7 $equiv and lc $equiv eq "refresh" and defined $content
1931 55 0 124 $req and $res
55 3 121 $req and $res and $self->stack_depth

or 2 conditions

line l !l condition
912 30 19 $number ||= 1
940 4 9 $number ||= 1
1147 1 15 shift() || 1
1330 0 0 $args{'x'} || 0
0 0 $args{'y'} || 0
1405 1 1 delete $opts{'binmode'} || ''
1424 2 1 shift() || ''
1449 1 4 shift() || \*STDOUT
1463 1 4 shift() || \*STDOUT
1477 2 5 shift() || \*STDOUT
1488 1 1 shift() || \*STDOUT
1593 194 13 $res->content_type || ''
1934 120 1 $self->{'page_stack'} ||= []

or 3 conditions

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