Branch Coverage

blib/lib/Net/WebSocket/Server/Connection.pm
Criterion Covered Total %
branch 30 68 44.1


line true false branch
33 0 2 unless exists $self->{$key}
34 0 2 if ref $self->{$key} eq 'CODE' and ref $value ne 'CODE'
46 0 1 if $self->{'socket'}->can('accept_SSL') and not $self->{'socket'}->opened
56 0 6 unless exists $$self{"on_$key"}
57 0 6 unless ref $value eq 'CODE'
77 0 0 if (@_)
79 0 0 $self->{'nodelay'} ? :
0 0 unless $self->{'handshake'}
86 0 0 if @_
92 0 0 if (@_)
93 0 0 if $self->{'parser'}
104 1 1 if $self->{'disconnecting'}
110 1 0 if (defined $code or defined $reason)
112 0 1 unless defined $reason
115 1 0 unless $self->{'handshake'}
131 0 20 if ($self->{'handshake'})
137 20 0 if defined $data
140 0 20 unless (defined $bytes)
141 0 0 if $@
151 0 19 if ($self->{'needs_ssl'})
153 0 0 if ($self->{'socket'}->errstr)
157 0 0 unless $ssl_done
162 0 19 unless ($len = sysread($self->{'socket'}, $data, 8192))
170 1 18 if ($self->{'handshake'})
172 0 1 if ($self->{'handshake'}->error) { }
1 0 elsif ($self->{'handshake'}->is_done) { }
176 0 1 unless do { local $SIG{'__WARN__'} = sub { } ; $self->{'socket'}->connected }
182 1 0 if $self->{'nodelay'}
192 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) { }
199 1 0 length $bytes ? :
204 0 17 if ($@)