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)
213 2 10 if ($name eq "Sec-WebSocket-$hdr_part")
214 0 2 if (exists $$self{"_got_$name"})
222 1 3 if ($name eq 'Sec-WebSocket-Accept') { }
1 2 elsif ($name eq 'Sec-WebSocket-Protocol') { }
227 0 1 unless (grep {$_ eq $value;} @{$$self{'subprotocols'};})
248 1 2 unless 'MIME::Base64'->can('encode')