Branch Coverage

blib/lib/HTTP/Request/FromCurl.pm
Criterion Covered Total %
branch 107 128 83.5


line true false branch
221 1 150 if ($options{'command'}) { }
0 150 elsif ($options{'command_curl'}) { }
234 1 929 if $_ eq "-:"
241 0 151 unless $p->getoptionsfromarray($cmd, \my %curl_options, @option_spec)
245 150 1 unless $curl_options{'url'}
248 150 1 wantarray ? :
271 7 4 if ($segments[-1] and $segments[-1] eq '..' || $segments[-1] eq '.')
281 13 18 if ($segments[$i] ne '..' and $segments[$i + 1] eq '..') { }
289 11 162 if (@segments < 2)
298 2 558 if (exists $headers->{$h}) { }
299 2 0 unless (ref $headers->{$h})
310 12 1 if ($read_files) { }
311 6 6 if ($data =~ /^\@(.*)/u) { }
312 0 6 unless open my $fh, "<", $1
321 1 0 $data =~ /^\@(.*)/u ? :
330 4 0 if ($read_files) { }
331 1 3 if ($data =~ /^<(.*)/u) { }
1 2 elsif ($data =~ /^\@(.*)/u) { }
332 0 1 unless open my $fh, "<", $1
344 0 0 if ($data =~ /^[<\@](.*)/u) { }
355 130 31 unless $options->{'header'}
358 154 7 unless $options->{'data'}
359 160 1 unless $options->{'data-ascii'}
362 149 12 unless $options->{'data-raw'}
364 160 1 unless $options->{'data-urlencode'}
365 158 3 unless $options->{'data-binary'}
366 160 1 unless $options->{'json'}
369 2 159 if ($options->{'form'})
373 4 0 /^([^=]+)=(.*)$/u ? :
377 2 159 if ($options->{'form-string'})
378 3 1 /^([^=]+)=(.*)$/u ? :
383 94 67 unless ($options->{'globoff'})
387 1 160 if ($options->{'max-filesize'} and $options->{'max-filesize'} =~ /^(\d+)([kmg])$/iu)
402 159 4 $uri->can('host_port') ? :
424 0 1 unless /\A([^\@=]*)([=\@])?(.*)\z/msu
427 0 1 if (not $op) { }
1 0 elsif ($op eq '@') { }
432 0 1 if (defined $name and length $name) { }
442 24 139 if (@post_read_data or @post_binary_data or @post_raw_data or @post_urlencode_data) { }
1 138 elsif (@post_json_data) { }
457 4 159 if (@form_args) { }
2 157 elsif ($options->{'get'}) { }
2 155 elsif ($options->{'head'}) { }
23 132 elsif (defined $data) { }
471 2 0 if ($data)
473 1 1 if (defined $q and length $q) { }
489 1 22 if (@post_json_data) { }
501 23 140 if (defined $body)
505 1 162 if ($options->{'oauth2-bearer'})
509 5 158 if ($options->{'user'})
510 0 5 if ($options->{'anyauth'} or $options->{'digest'} or $options->{'ntlm'} or $options->{'negotiate'}) { }
521 0 5 unless ($info =~ /:/u)
533 43 0 /^\s*([^:\s]+)\s*:\s*(.*)$/u ? :
537 74 89 if (defined $options->{'user-agent'})
541 0 163 if (defined $options->{'referrer'})
545 0 163 if (defined $options->{'range'})
553 282 90 unless ($headers_lc{lc $k})
557 159 4 unless ($headers{'Host'})
561 1 162 if (defined $options->{'cookie-jar'})
565 3 160 if (defined(my $c = $options->{'cookie'}))
566 2 1 if ($c =~ /=/u) { }
581 2 161 if ($options->{'compressed'})
588 0 489 if ($options->{$kind})
611 4 159 scalar @form_args ? :