Branch Coverage

blib/lib/Graph/Graph6.pm
Criterion Covered Total %
branch 155 196 79.0


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 32 11 if (defined $options{'str'})
95 0 152 unless (defined $len)
101 9 143 if ($skip_newlines and $str eq "\n")
109 2 141 if ($allow_header and $str eq '>')
111 2 0 if (defined $str)
121 96 45 if ($n >= 0 and $n <= 63)
125 12 33 if ($str eq '' or $str eq "\n")
130 3 30 if ($initial and $str eq '&')
136 23 7 if ($initial and $str eq ':')
142 0 7 if ($str eq "\r")
158 41 1 if ($n <= 62)
162 1 0 if ($n < 0)
167 0 0 if ($n <= 62) { }
175 0 0 if ($n2 < 0)
189 8 35 unless (defined $fh)
190 8 0 if (defined(my $filename = $options{'filename'}))
192 1 7 unless (open $fh, '<', $filename)
202 13 29 if (my $format_func = $options{'format_func'})
205 0 42 if (my $format_ref = $options{'format_ref'})
209 11 31 if ($num_vertices < 0)
212 18 13 if (my $num_vertices_func = $options{'num_vertices_func'})
215 12 19 if (my $num_vertices_ref = $options{'num_vertices_ref'})
221 11 20 if ($edge_aref)
224 22 9 if ($format eq 'sparse6') { }
237 40 53 if ($bits < 1)
239 8 32 if ($n < 0)
254 2 17 if ($n2 < 0)
267 19 64 if ($x > $v) { }
52 12 elsif ($v < $num_vertices) { }
272 25 27 if ($edge_func)
273 26 26 if ($edge_aref)
285 22 45 if ($n & $mask)
289 17 5 if ($edge_func)
290 1 21 if ($edge_aref)
294 8 1 if ($format eq 'graph6') { }
300 0 10 if (($n = &$read_byte()) < 0)
307 18 24 if ($from >= $to)
309 6 12 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 10 unless (defined $len)
343 1 9 if ($str eq "\r")
346 9 0 if ($str eq '' or $str eq "\n")
356 30 13 if (&$read())
359 11 2 if (defined $error)
377 7 70 if ($n > 258047) { }
1 69 elsif ($n > 62) { }
405 44 24 if (not $fh and defined(my $str_ref = $options{'str_ref'}))
411 2 66 if (not $fh and defined(my $filename = $options{'filename'}))
414 0 2 unless open $fh, '>', $filename
419 8 60 unless (defined $format)
422 2 66 if (not defined $num_vertices and my $edge_aref = $options{'edge_aref'})
431 0 68 unless (defined $num_vertices)
437 8 60 $options{'header'} ? :
12 26 $format eq 'digraph6' ? :
30 38 $format eq 'sparse6' ? :
0 68 unless print $fh $options{'header'} ? ">>$format<<" : (), $format eq 'sparse6' ? ':' : ($format eq 'digraph6' ? '&' : ()), _number_to_string($num_vertices)
449 545 109 if ($bitpos > 0) { }
452 0 109 unless print $fh chr $word + 63
459 30 38 if ($format eq 'sparse6') { }
462 27 3 if (my $edge_aref = $options{'edge_aref'})
465 3 52 $_->[0] > $_->[1] ? :
470 0 22 unless $Graph::Graph6::a->[1] <=> $Graph::Graph6::b->[1]
472 27 55 unless shift @edges
476 1 29 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 29 1 if ($num_vertices > 0)
510 0 145 unless &$put_bit($n >> $i & 1)
523 30 26 if ($to == $v + 1) { }
525 0 30 unless &$put_bit(1)
528 7 19 if ($to != $v)
530 0 7 unless &$put_bit(1) and &$put_n($to)
534 0 26 unless &$put_bit(0)
537 0 56 unless &$put_n($from)
542 22 8 if ($bitpos != 5)
553 0 7 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 74 unless &$put_bit(1)
570 7 31 if (not $edge_predicate and my $edge_aref = $options{'edge_aref'})
576 2 15 if ($from > $to and $format eq 'graph6')
587 26 12 if ($format eq 'graph6') { }
12 0 elsif ($format eq 'digraph6') { }
590 33 59 &$edge_predicate($from, $to) ? :
0 92 unless &$put_bit(&$edge_predicate($from, $to) ? 1 : 0)
596 27 145 &$edge_predicate($from, $to) ? :
0 172 unless &$put_bit(&$edge_predicate($from, $to) ? 1 : 0)
604 0 108 unless &$put_bit(0)
608 0 68 unless print $fh "\n"