Branch Coverage

blib/lib/Net/BitTorrent/Protocol/BEP03.pm
Criterion Covered Total %
branch 45 46 97.8


line true false branch
45 2 7 if (not defined $reserved or length $reserved != 8)
51 2 5 if (not defined $infohash or length $infohash != 20)
56 2 3 if (not defined $peerid or length $peerid != 20)
73 2 5 unless (defined $index and $index =~ /^\d+$/)
84 1 1 unless ($bitfield and unpack('b*', $bitfield) =~ /^[01]+$/)
97 3 10 unless (defined $index and $index =~ /^\d+$/)
103 3 7 unless (defined $offset and $offset =~ /^\d+$/)
108 3 4 unless (defined $length and $length =~ /^\d+$/)
119 3 8 unless (defined $index and $index =~ /^\d+$/)
124 3 5 unless (defined $offset and $offset =~ /^\d+$/)
129 1 4 unless (defined $data)
140 3 9 unless (defined $index and $index =~ /^\d+$/)
146 3 6 unless (defined $offset and $offset =~ /^\d+$/)
151 3 3 unless (defined $length and $length =~ /^\d+$/)
162 3 3 unless (defined $port and $port =~ /^\d+$/)
172 2 3 if (not $packet or length $packet < 68)
177 1 2 if ($protocol_name ne 'BitTorrent protocol')
193 1 8 if (not $packet or length $packet < 1)
201 1 5 if (not $packet or length $packet < 1)
209 1 6 if (not $packet or length $packet < 9)
222 2 6 if (not $packet or length $packet < 9)
235 1 5 if (not $packet or length $packet < 9)
248 0 2 if (not $packet or length $packet < 1)