Branch Coverage

blib/lib/Net/WebSocket/Handshake.pm
Criterion Covered Total %
branch 32 48 66.6


line true false branch
84 1 14 if ($opts{'extensions'})
100 0 2 unless ($self->{'_no_use_legacy'})
124 0 34 unless defined $v
162 0 5 if (my $hdrs_ar = $opts{'headers'})
221 0 5 unless (my $key_b64 = $self->{'key'})
241 3 2 $self->{'subprotocols'} && @{$self->{'subprotocols'};} ? :
249 4 1 unless $self->{'extensions'}
253 2 0 if ($xtn->isa('Net::WebSocket::Handshake::Extension')) { }
0 0 elsif ($self->_should_include_extension_in_headers($xtn)) { }
262 0 1 unless @handshake_xtns
272 1 1 unless ($self->{'_warned_legacy'})
286 1 5 unless $self->{'_connection_header_ok'}
287 1 5 unless $self->{'_upgrade_header_ok'}
300 0 0 if ($xtn_handler) { }
303 0 0 if ($xtn_handler->ok_to_use)
320 9 10 if ($hname eq 'connection') { }
9 1 elsif ($hname eq 'upgrade') { }
0 1 elsif ($hname eq 'sec-websocket-protocol') { }
0 1 elsif ($hname eq 'sec-websocket-extensions') { }
323 8 1 if ($t eq "upgrade")
328 1 8 unless ($self->{'_connection_header_ok'})
335 8 1 if ($t eq "websocket")
340 1 8 unless ($self->{'_upgrade_header_ok'})
346 0 0 unless (defined $self->{'_match_protocol'})