Branch Coverage

blib/lib/Net/WebSocket/Server/Connection.pm
Criterion Covered Total %
branch 28 60 46.6


line true false branch
32 0 2 unless exists $$self{$key}
33 0 2 if ref $$self{$key} eq 'CODE' and ref $value ne 'CODE'
50 0 6 unless exists $$self{"on_$key"}
51 0 6 unless ref $value eq 'CODE'
65 0 0 $sock && $sock->connected ? :
70 0 0 $sock && $sock->connected ? :
75 0 0 if (@_)
77 0 0 $$self{'nodelay'} ? :
0 0 unless $$self{'handshake'}
84 0 0 if @_
93 1 1 if $$self{'disconnecting'}
99 1 0 if (defined $code or defined $reason)
101 0 1 unless defined $reason
104 1 0 unless $$self{'handshake'}
120 0 20 if ($$self{'handshake'})
126 20 0 if defined $data
129 0 20 unless (defined $bytes)
130 0 0 if $@
141 0 19 unless ($len = sysread($$self{'socket'}, $data, 8192))
149 1 18 if ($$self{'handshake'})
151 0 1 if ($$self{'handshake'}->error) { }
1 0 elsif ($$self{'handshake'}->is_done) { }
155 0 1 unless do { local $SIG{'__WARN__'} = sub { } ; $$self{'socket'}->connected }
161 1 0 if $$self{'nodelay'}
171 6 12 if ($$self{'parser'}->is_binary) { }
5 7 elsif ($$self{'parser'}->is_text) { }
6 1 elsif ($$self{'parser'}->is_pong) { }
1 0 elsif ($$self{'parser'}->is_close) { }
178 1 0 length $bytes ? :
183 0 17 if ($@)