Branch Coverage

blib/lib/CGI/Tiny/Multipart.pm
Criterion Covered Total %
branch 51 66 77.2


line true false branch
21 5 13 if defined $boundary_quoted
22 5 13 defined $boundary_quoted ? :
29 8 17 unless $input_is_scalar
37 17 8 if ($input_is_scalar) { }
41 8 0 $remaining < $buffer_size ? :
42 0 8 unless my $read = read($input, $buffer, $chunk, length $buffer)
46 25 0 unless ($state{'parsing_headers'} or $state{'parsing_body'})
49 22 3 if ($next_pos >= 0 and $end_pos < 0 || $end_pos > $next_pos) { }
1 2 elsif ($end_pos >= 0) { }
62 118 116 if ($state{'parsing_headers'}) { }
64 116 179 if ($pos == 0)
73 2 177 unless defined $value
77 115 62 if (lc $name eq 'content-disposition')
80 0 160 unless lc $field_name eq 'name' or lc $field_name eq 'filename'
81 143 17 if defined $field_quoted
82 143 17 defined $field_quoted ? :
86 0 116 if $state{'parsing_headers'}
91 97 19 if ($next_pos >= 0 and $end_pos < 0 || $end_pos > $next_pos) { }
19 0 elsif ($end_pos >= 0) { }
0 0 elsif (length $buffer > length($next_boundary) + 2) { }
92 84 13 if (not $state{'parsed_optional_crlf'} and $next_pos >= 2)
102 19 0 if (not $state{'parsed_optional_crlf'} and $end_pos >= 2)
111 0 0 unless ($state{'parsed_optional_crlf'})
119 103 13 unless (defined $current->{'filename'} and $options->{'discard_files'})
120 41 62 if ($options->{'parse_as_files'} or defined $current->{'filename'} and not defined $options->{'parse_as_files'}) { }
122 12 29 if (defined $options->{'on_file_buffer'}) { }
126 29 0 unless (defined $current->{'file'})
128 28 1 unless $options->{'tempfile_args'}
132 29 0 if ($is_eof)
138 62 0 unless defined $current->{'content'}
143 19 97 if $state{'done'}
144 0 97 if $state{'parsing_body'}
151 3 20 unless $state{'done'}