Branch Coverage

blib/lib/Net/WebSocket/Handshake/Client.pm
Criterion Covered Total %
branch 21 32 65.6


line true false branch
79 3 0 if (length $opts{'uri'})
83 0 3 unless ($opts{'uri_schema'} and grep {$_ eq $opts{'uri_schema'};} ('ws', 'wss', 'http', 'https'))
87 0 3 unless (length $opts{'uri_auth'})
114 0 1 if ($code ne 101)
156 1 0 if $received eq $should_be
168 2 0 unless (length $path)
172 0 2 if (length $self->{'uri_query'})
192 1 1 $self->{'origin'} ? :
200 0 1 unless $self->{'_accept_header_ok'}
202 0 1 if (@needed)
217 2 10 if ($name eq "sec-websocket-$hdr_part")
218 0 2 if (exists $$self{"_got_$name"})
226 1 3 if ($name eq 'sec-websocket-accept') { }
1 2 elsif ($name eq 'sec-websocket-protocol') { }
231 0 1 unless (grep {$_ eq $value;} @{$$self{'subprotocols'};})
252 1 2 unless 'MIME::Base64'->can('encode')