Branch Coverage

blib/lib/Net/ICAP/Message.pm
Criterion Covered Total %
branch 129 190 67.8


line true false branch
83 1 29 if exists $args{'version'}
85 3 27 if exists $args{'headers'} and $rv
86 1 29 if exists $args{'reqhdr'} and $rv
87 0 30 if exists $args{'reshdr'} and $rv
91 1 0 if $rv and exists $args{'body_type'} and exists $args{'body'}
92 1 29 if exists $args{'trailer'} and $rv
94 0 30 if $rv and exists $args{'chunked_handler'}
97 0 30 if (exists $args{'time-out'})
133 28 27 if (defined $msg)
152 2 12 scalar @_ ? :
171 2 17 scalar @_ ? :
190 0 17 scalar @_ ? :
209 1 17 scalar @_ ? :
228 2 34 if (@_) { }
235 34 2 ref $rv eq 'ARRAY' ? :
252 13 12 if (defined $version) { }
255 13 0 if ($version eq 'ICAP/1.0') { }
291 0 290 if $to
293 290 0 if (defined $ref) { }
294 5 285 if (ref $ref eq 'SCALAR') { }
5 280 elsif (ref $ref eq 'GLOB') { }
280 0 elsif ($ref->isa('IO::Handle')) { }
309 0 290 if $to
312 0 290 if ($@ and $@ =~ /connection timed out/s)
339 71 0 if (defined $ref) { }
340 71 0 if (ref $ref eq 'SCALAR') { }
0 0 elsif (ref $ref eq 'GLOB') { }
0 0 elsif ($ref->isa('IO::Handle')) { }
373 27 0 if (scalar @lines)
384 0 121 unless defined $k and defined $v
385 0 121 exists $headers{$k} ? :
408 70 206 if (exists $headers{$h})
410 70 0 if defined $v and length $v
434 100 28 if ($k =~ /^X-\w+[\w-]*/s or grep {$_ eq $k;} @valid) { }
448 30 0 if scalar keys %headers
476 10 62 @_ ? :
483 72 0 if ($header =~ /^X-\w+[\w-]*/s or grep {$_ eq $header;} @valid) { }
486 10 62 if (@_) { }
490 10 0 if (defined $value) { }
533 7 0 if (defined($line = $obj->_getLine($input)))
538 0 7 if defined $cref
547 0 9 unless (defined $line)
559 7 0 if (length $chunk == $c) { }
563 0 7 if defined $cref
567 7 0 if (defined $line) { }
571 0 7 if defined $ieof
606 0 10 if (defined $cref) { }
10 0 elsif (defined $body) { }
608 0 0 if (defined $body and length $body) { }
0 0 elsif (defined $body) { }
629 1 9 $obj->ieof ? :
632 10 0 defined $rv ? :
655 12 0 if (defined $encap) { }
662 0 12 unless ($n == 1)
667 0 12 unless ($entities[$#entities] =~ /^\w+-body=\d+$/s)
675 0 12 unless ($n <= 1)
680 0 12 unless ($n <= 1)
688 0 24 unless (not defined $n or $_ > $n)
694 12 12 unless (defined $n)
695 0 12 unless ($_ == 0)
706 0 12 if (scalar grep((!/^(?:re[qs]-hdr|(?:opt|null|re[qs])-body)=\d+$/s), @entities))
713 12 0 if ($rv)
719 12 12 if ($t =~ /-hdr$/s) { }
12 0 elsif ($t =~ /-body$/s) { }
723 12 69 if $line eq "\r\n"
731 7 5 unless ($t eq 'null-body')
739 12 12 if (@entities)
741 10 2 $l == 0 ? :
742 0 12 unless (length $text == $l)
753 7 5 if (grep /\b(?:res|req|opt)-body=/s, $encap)
755 2 5 if (defined $line and $line ne "\r\n")
758 2 2 if $line eq "\r\n"
792 10 7 if (defined $t and length $t)
799 5 12 if (defined $t and length $t)
800 2 3 if length $encap
807 10 7 if (defined $tt and length $tt and defined $t and length $t) { }
808 10 0 if length $encap
811 3 4 if length $encap
847 27 148 if $line eq "\r\n"
852 27 0 if (length $icap_msg)
888 2 15 unless defined $d and length $d
893 17 0 length $t ? :
17 0 if $rv = defined $t
896 17 0 if ($rv)
899 17 0 length $t ? :
17 0 if $rv = defined $t
903 17 0 if ($rv)
905 10 7 if (defined $t and length $t)
913 17 0 if ($rv)
915 5 12 if (defined $t and length $t)
923 17 0 if ($rv)
925 10 7 if (defined $t and length $t)
932 17 0 if ($rv)
934 2 15 if (defined $t and length $t)
941 17 0 if ($rv)