Branch Coverage

blib/lib/Net/Async/Redis/Protocol.pm
Criterion Covered Total %
branch 60 102 58.8


line true false branch
42 0 55 if &blessed($data)
43 13 42 if (my $type = &reftype($data))
44 12 1 if ($type eq 'ARRAY') { }
1 0 elsif ($type eq 'HASH') { }
51 5 37 if (not defined $data) { }
4 33 elsif (not length $data) { }
16 17 elsif (($data ^ $data) eq '0' and int 0 + $data eq $data and not $data =~ /inf/i) { }
3 14 elsif (($data ^ $data) eq '0' and 0 + $data eq $data) { }
12 4 elsif (length $data < 100 and not $data =~ /[$CRLF]/) { }
52 1 4 $self->{'protocol'} eq 'resp3' ? :
96 0 61 if ($Net::Async::Redis::Protocol::log->is_trace)
100 6 55 if (defined $len)
101 0 6 unless length $_ >= $len + 2
102 0 6 unless substr($_, $len, 2, '') eq "\r\n"
105 6 0 unless length $_
107 12 43 if (s/^\+([^\x0D]*)$CRLF//) { }
16 27 elsif (s/^:([^\x0D]*)$CRLF//) { }
3 24 elsif (s/^,([^\x0D]*)$CRLF//) { }
0 24 elsif (s/^#([tf])$CRLF//) { }
6 18 elsif (s/^\$([0-9]+)$CRLF//) { }
0 18 elsif (s/^=([0-9]+)$CRLF//) { }
5 13 elsif (s/^\$-1$CRLF// or s/^\*-1$CRLF// or s/^_$CRLF//) { }
0 13 elsif (s/^>([0-9]+)$CRLF//) { }
12 1 elsif (s/^\*([0-9]+)$CRLF//) { }
0 1 elsif (s/^~([0-9]+)$CRLF//) { }
1 0 elsif (s/^%([0-9]+)$CRLF//) { }
0 0 elsif (s/^\|([0-9]+)$CRLF//) { }
0 0 elsif (s/^-([^\x0D]*)$CRLF//) { }
0 0 elsif (s/^!([^\x0D]*)$CRLF//) { }
111 0 16 unless &looks_like_number($int) and int $int eq $int
115 0 3 unless &looks_like_number($num) and lc 0 + $num eq lc $num
121 0 6 unless 0 + $len eq $len
125 0 0 unless 0 + $len eq $len
131 0 0 unless 0 + $pending eq $pending
132 0 0 if $pending
138 0 12 unless 0 + $pending eq $pending
139 10 2 if ($pending) { }
146 0 0 unless 0 + $pending eq $pending
147 0 0 if ($pending) { }
154 0 1 unless 0 + $pending eq $pending
155 1 0 if ($pending) { }
165 0 0 unless 0 + $pending eq $pending
166 0 0 if $pending
177 26 29 if length $_
186 22 33 unless $self->{'active'}
35 20 unless @{[] unless $self->{'active'};}
189 9 11 if --$self->{'active'}[-1]{'pending'}
191 1 10 $active->{'type'} eq 'map' ? :
194 0 11 if $active->{'type'} eq 'attribute'
200 0 0 if $self->{'error'}
206 0 0 if $self->{'pubsub'}