Branch Coverage

lib/HTTP/Promise/Body/Form/Field.pm
Criterion Covered Total %
branch 18 44 40.9


line true false branch
30 0 5 unless exists $opts->{'name'} and defined $opts->{'name'} and length $opts->{'name'}
32 5 0 if (exists $opts->{'headers'}) { }
34 4 1 if ($self->_is_a($opts->{'headers'}, 'HTTP::Promise::Headers')) { }
1 0 elsif (exists $opts->{'headers'} and $self->_is_array($opts->{'headers'})) { }
40 0 1 unless $self->_load_class("HTTP::Promise::Headers")
42 0 1 unless defined $headers
52 0 0 unless $self->_load_class("HTTP::Promise::Headers")
56 1 4 if (exists $opts->{'file'} and $opts->{'file'}) { }
0 4 elsif (exists $opts->{'value'}) { }
4 0 elsif (exists $opts->{'body'}) { }
58 0 1 unless $self->_load_class("HTTP::Promise::Body")
65 0 0 unless $self->_load_class("HTTP::Promise::Body")
72 0 4 if ($self->_is_a('HTTP::Promise::Body')) { }
0 4 elsif ($self->_is_a($opts->{'body'}, 'Module::Generic::File')) { }
4 0 elsif (not ref $opts->{'body'} or $self->_is_scalar($opts->{'body'}) or overload::Method($opts->{'body'}, '""')) { }
78 0 0 unless $self->_load_class("HTTP::Promise::Body")
86 0 4 unless $self->_load_class("HTTP::Promise::Body")
98 0 0 unless $self->_load_class("HTTP::Promise::Body")
105 0 5 unless $self->SUPER::init($opts)
115 0 0 if not $body or $body->is_empty
123 0 0 if not $body or $body->is_empty
136 0 2 unless defined $data