Condition Coverage

blib/lib/HTML/DOM/Element/Form.pm
Criterion Covered Total %
condition 109 155 70.3


and 2 conditions

line l !l condition
917 2 4 $_ != $self and $_->{'_HTML_DOM_sel'} = 0
996 36 10 $_ != $self and $_->type eq 'radio' and $_->name eq $name and $_->{'_HTML_DOM_checked'} = 0

and 3 conditions

line !l l&&!r l&&r condition
42 105 3 54 $elem_elems{$_->tag} && $_->attr('type') ne 'image'
156 3 16 5 $tag eq 'input' and $type =~ /^(?:submit|image)\z/
18 0 1 $tag eq 'button' and ($type || 'submit') eq 'submit'
158 6 0 0 $name and $_->name ne $name
193 0 2 0 $type and $type ne $_->type
195 2 0 0 $no and $no != $c
208 30 0 0 $type and $type ne $_->type
233 1 4 3 @v == 1 and ref $v[0]
442 4 3 0 $btn->disabled && croak("The value '$_[0]' has been disabled for field '${\$self->name;}'")
474 0 0 7 defined $name and length $name
797 0 0 0 $opt->disabled && croak("The value '$_[0]' has been disabled for field '${\$self->name;}'")
907 40 0 11 @_ and !$ret != !$_[0]
987 68 18 23 @_ and !$ret != !($self->{'_HTML_DOM_checked'} = shift())
86 8 15 @_ and !$ret != !($self->{'_HTML_DOM_checked'} = shift()) and not $ret
26 7 8 @_ and !$ret != !($self->{'_HTML_DOM_checked'} = shift()) and not $ret and $self->type eq 'radio'
989 0 0 8 my $form = $self->form and defined(my $name = $self->name)
996 8 28 18 $_ != $self and $_->type eq 'radio'
36 8 10 $_ != $self and $_->type eq 'radio' and $_->name eq $name
1017 86 101 0 (caller) =~ /^(?:HTML::Form(?:::Input)?|WWW::Mechanize)\z/ and ($type = $self->type) =~ /^(?:button|reset)\z/ && (return) || $type eq 'checkbox'
1116 0 2 54 defined $name and length $name
1252 0 0 2 defined $name and length $name

or 2 conditions

line l !l condition
58 3 3 $self->{'_HTML_DOM_mg_elems'} ||= []
66 7 0 $self->{'_HTML_DOM_elems'} ||= []
155 23 1 eval { do { $_->tag } } || ''
156 0 1 $type || 'submit'
202 0 30 $no ||= 1
287 20 10 Encode::resolve_alias($enc) || (return)
349 16 17 $self->acceptCharset || (next)
358 4 21 ($self->ownerDocument || (next))->charset || (next)
709 7 2 delete $self->{'_HTML_DOM_f'} || (return $ret || ())
748 1 0 $self->options->item(shift()) || (return)
902 14 23 $self->attr('selected') || 0
1060 0 14 defined $_ or $_ = 1
1078 3 0 (shift())->target->form || (return)
1080 1 0 (shift())->target->form || (return)
1268 2 25 $a->type || 'submit'
1277 3 0 (shift())->target->form || (return)
1279 1 0 (shift())->target->form || (return)

or 3 conditions

line l !l&&r !l&&!r condition
20 4303 682 23 $self->isa(scalar caller) or (caller)->isa('HTML::DOM::_TreeBuilder')
33 42 14 0 $self->{'_HTML_DOM_elems'} ||= do { my $collection = 'HTML::DOM::Collection::Elements'->new(my $list = 'HTML::DOM::NodeList::Magic'->new(sub { BEGIN {${^WARNING_BITS} = "\x54\x55\x55\x55\x55\x55\x55\x55\x55\x55\x51\x55\x55\x55\x55\x55\x55\x15"} grep(($elem_elems{$_->tag} && $_->attr('type') ne 'image'), $self->descendants), @{[] unless $self->{'_HTML_DOM_mg_elems'};}; } )); $self->ownerDocument->_register_magic_node_list($list); $collection }
156 5 0 19 $tag eq 'input' and $type =~ /^(?:submit|image)\z/ or $tag eq 'button' and ($type || 'submit') eq 'submit'
225 0 132 43 not defined $n or $n ne $name
246 1 5 0 $err ||= $@
273 0 6 8 not defined $n or $seen{$n}++
287 18 2 0 $xwfu ? $ascii_encodings_re : $encodings_re ||= qr/^${\join('|', map(quotemeta($_), 'Encode'->encodings('Byte')));}\z/
321 4 22 0 $charsets->[0] || (++$fallback, 'utf8')
338 18 9 6 $method eq 'get' || !($self->enctype =~ m[^multipart/form-data\z]i)
513 0 43 123 ($elem = $list->item($_))->id eq $name or $elem->attr('name') eq $name
525 0 22 22 $_->id eq $name || $_->attr('name') eq $name
706 28 0 32 ($self->look_up('_tag', 'form'))[0] || $self->{'_HTML_DOM_f'}
909 1 7 3 not $sel or $sel->multiple
1017 0 40 59 ($type = $self->type) =~ /^(?:button|reset)\z/ && (return) || $type eq 'checkbox'
1127 0 1 4 uc $form->method ne 'POST' or lc $form->enctype ne 'multipart/form-data'
1139 0 1 3 not defined $file or length $file == 0
1190 10 1 0 $_[0]->firstChild || (@_ > 1 && $_[0]->appendChild((shift())->ownerDocument->createTextNode(shift())), (return ''))
1249 4 0 4 not $type or $type eq 'submit'