Branch Coverage

blib/lib/Graph/Graph6.pm
Criterion Covered Total %
branch 152 196 77.5


line true false branch
44 0 5 unless (defined $str)
47 3 2 if ($str eq substr('>>graph6<<', 0, length $str)) { }
0 2 elsif ($str eq substr('>>sparse6<<', 0, length $str)) { }
0 2 elsif ($str eq substr('>>digraph6<<', 0, length $str)) { }
48 0 3 if (length $str == 10)
55 0 0 if (length $str == 11)
62 0 0 if (length $str == 12)
77 27 3 if (defined $options{'str'})
95 0 108 unless (defined $len)
101 9 99 if ($skip_newlines and $str eq "\n")
109 2 97 if ($allow_header and $str eq '>')
111 2 0 if (defined $str)
121 65 32 if ($n >= 0 and $n <= 63)
125 8 24 if ($str eq '' or $str eq "\n")
130 3 21 if ($initial and $str eq '&')
136 15 6 if ($initial and $str eq ':')
142 0 6 if ($str eq "\r")
158 28 1 if ($n <= 62)
162 1 0 if ($n < 0)
167 0 0 if ($n <= 62) { }
175 0 0 if ($n2 < 0)
189 2 28 unless (defined $fh)
190 2 0 if (defined(my $filename = $options{'filename'}))
192 1 1 unless (open $fh, '<', $filename)
202 0 29 if (my $format_func = $options{'format_func'})
205 0 29 if (my $format_ref = $options{'format_ref'})
209 9 20 if ($num_vertices < 0)
212 7 13 if (my $num_vertices_func = $options{'num_vertices_func'})
215 12 8 if (my $num_vertices_ref = $options{'num_vertices_ref'})
221 11 9 if ($edge_aref)
224 14 6 if ($format eq 'sparse6') { }
237 28 36 if ($bits < 1)
239 5 23 if ($n < 0)
254 2 11 if ($n2 < 0)
267 16 41 if ($x > $v) { }
34 7 elsif ($v < $num_vertices) { }
272 7 27 if ($edge_func)
273 26 8 if ($edge_aref)
285 13 33 if ($n & $mask)
289 8 5 if ($edge_func)
290 1 12 if ($edge_aref)
294 5 1 if ($format eq 'graph6') { }
300 0 5 if (($n = &$read_byte()) < 0)
307 9 12 if ($from >= $to)
309 3 6 unless $to < $num_vertices
319 0 5 if (($n = &$read_byte()) < 0)
326 5 20 if ($to >= $num_vertices)
328 1 4 unless $from < $num_vertices
339 0 7 unless (defined $len)
343 1 6 if ($str eq "\r")
346 6 0 if ($str eq '' or $str eq "\n")
356 19 11 if (&$read())
359 10 1 if (defined $error)
377 7 17 if ($n > 258047) { }
1 16 elsif ($n > 62) { }
405 13 2 if (not $fh and defined(my $str_ref = $options{'str_ref'}))
411 2 13 if (not $fh and defined(my $filename = $options{'filename'}))
414 0 2 unless open $fh, '>', $filename
419 8 7 unless (defined $format)
422 2 13 if (not defined $num_vertices and my $edge_aref = $options{'edge_aref'})
431 0 15 unless (defined $num_vertices)
437 2 13 $options{'header'} ? :
3 8 $format eq 'digraph6' ? :
4 11 $format eq 'sparse6' ? :
0 15 unless print $fh $options{'header'} ? ">>$format<<" : (), $format eq 'sparse6' ? ':' : ($format eq 'digraph6' ? '&' : ()), _number_to_string($num_vertices)
449 120 24 if ($bitpos > 0) { }
452 0 24 unless print $fh chr $word + 63
459 4 11 if ($format eq 'sparse6') { }
462 1 3 if (my $edge_aref = $options{'edge_aref'})
465 0 4 $_->[0] > $_->[1] ? :
470 0 3 unless $Graph::Graph6::a->[1] <=> $Graph::Graph6::b->[1]
472 1 4 unless shift @edges
476 1 3 if (not $edge_iterator and my $edge_predicate = $options{'edge_predicate'})
484 32 465 if ($from > $to)
486 1 31 if ($to >= $num_vertices)
491 1 495 if (&$edge_predicate($from, $to))
502 3 1 if ($num_vertices > 0)
510 0 20 unless &$put_bit($n >> $i & 1)
523 2 3 if ($to == $v + 1) { }
525 0 2 unless &$put_bit(1)
528 1 2 if ($to != $v)
530 0 1 unless &$put_bit(1) and &$put_n($to)
534 0 3 unless &$put_bit(0)
537 0 5 unless &$put_n($from)
542 1 3 if ($bitpos != 5)
553 0 0 if ($width >= 1 and $width <= 4 and $num_vertices == 1 << $width and $bitpos >= $width and $v == $num_vertices - 2)
558 0 0 unless &$put_bit(0)
563 0 4 unless &$put_bit(1)
570 7 4 if (not $edge_predicate and my $edge_aref = $options{'edge_aref'})
576 2 15 if ($from > $to and $format eq 'graph6')
587 8 3 if ($format eq 'graph6') { }
3 0 elsif ($format eq 'digraph6') { }
590 16 22 &$edge_predicate($from, $to) ? :
0 38 unless &$put_bit(&$edge_predicate($from, $to) ? 1 : 0)
596 7 36 &$edge_predicate($from, $to) ? :
0 43 unless &$put_bit(&$edge_predicate($from, $to) ? 1 : 0)
604 0 33 unless &$put_bit(0)
608 0 15 unless print $fh "\n"