Branch Coverage

blib/lib/Mock/Data/Charset.pm
Criterion Covered Total %
branch 190 258 73.6


line true false branch
20 7 39 if (@_ == 1 and not ref $_[0])
23 0 7 if (ref $class)
31 25 14 @_ != 1 ? :
34 6 33 if defined $self{'classes'}
35 2 37 if defined $self{'codepoints'}
36 0 39 if defined $self{'codepoint_ranges'}
37 0 39 if defined $self{'negate'}
38 3 36 if (defined $self{'chars'})
42 0 39 if (defined $self{'ranges'})
45 0 0 ref $_ ? :
50 0 39 if (ref $class)
51 0 0 unless (keys %parse or defined $self{'notation'} or $self{'members'} or $self{'member_invlist'})
59 22 17 if (defined $self{'notation'} and not keys %parse) { }
11 6 elsif (keys %parse) { }
67 0 11 if $self{'members'} or $self{'member_invlist'}
72 0 6 unless $self{'members'} or $self{'member_invlist'}
80 16 11 unless ($_[0]{'_parse'})
82 16 0 if (defined $self->{'notation'}) { }
0 0 elsif ($self->{'members'}) { }
0 0 elsif (my $inv = $self->{'member_invlist'}) { }
91 0 0 if ($inv->[$i] + 1 == $$inv[$i + 1]) { }
94 0 0 if ($i == $#$inv)
110 0 113 if @_ > 1
119 0 113 if @_ > 1
125 83 779 $_[0]{'members'} ? :
138 21 0 if (@$invlist > 1)
143 0 21 if 1 & @$invlist
151 5 1 if (@$invlist > 1)
156 2 4 if 1 & @$invlist
175 6 19 if (@$invlist & 1)
183 0 1607 if (@_ > 1)
198 3 9 if (not defined $max_codepoint or $max_codepoint > 1000 or not defined $self->{'notation'})
207 35 0 if ("Internals"->can("SvREADONLY"))
218 1 0 unless (defined $_unicode_chars)
239 1 8 ord $set == 94 ? :
243 8 1 if ($max_codepoint < 256) { }
246 31 3 defined $_ ? :
251 1 0 unless defined $_unicode_chars
255 1 0 $max_codepoint < 1114111 ? :
258 1 0 if (@endpoints)
266 18 1 if (defined $endpoints[$i + 1] and ord $endpoints[$i + 1]) { }
1 0 elsif (defined $endpoints[$i]) { }
281 4 5 if ($max_codepoint < 1114111 and 1 & @invlist)
291 5 21 if (defined(my $cp = $parse->{'codepoints'}))
297 2 3 if ($invlist[-1] == $chars[$i]) { }
306 10 16 if (my $r = $parse->{'codepoint_ranges'})
310 1 10 if (@invlists and $invlists[-1][-1] < $start) { }
0 10 elsif (@invlists and $invlists[-1][0] > $limit) { }
321 11 15 if ($parse->{'classes'})
327 1 25 if ($parse->{'negate'})
328 1 0 if ($invlist->[0]) { }
344 82 31 if (@_)
345 79 3 ref $_[0] eq 'HASH' ? :
346 80 2 @_ ? :
350 86 27 !(defined $cp_min || defined $cp_max) ? :
358 0 1 $_compile ? :
0 80 $_compile ? :
0 2 $_compile ? :
4 26 $_compile ? :
30 0 ref $len eq 'CODE' ? :
2 30 ref $len eq 'ARRAY' ? :
80 32 !ref($len) ? :
1 112 !defined($len) ? :
364 97 16 if ($self->{'members'} or $member_count < 500) { }
371 4 93 if $_compile
384 0 16 if $_compile
396 21 6 !defined($cp_min) ? :
401 0 27 !defined($cp_max) ? :
403 17 10 defined $at ? :
411 0 32 unless length $notation
412 0 32 if $notation eq "^"
461 5 17 if (ord $class == 94)
467 2 6 unless defined $have_prop_invlist
469 8 0 $have_prop_invlist ? :
474 0 3 unless /\G( [0-9A-Fa-f]{2} | \{ ([0-9A-Fa-f]+) \} )/cgx
476 1 2 defined $2 ? :
480 0 5 unless /\G( [0-7]{3} | 0 | o\{ ([0-7]+) \} ) /cgx
482 1 4 defined $2 ? :
486 2 0 if /\G \{ ([^}]+) \} /cgx
495 0 7 unless /\G \{ ([^}]+) \} /cgx
497 4 3 $negate ? :
506 2 35 if /\G \^ /cgx
507 0 37 if (/\G]/cg)
511 80 45 if (/\G ( \\ | - | \[: | \] ) /cgx) { }
0 45 elsif ($flags and ($flags->{'x'} || 0) >= 2 and /\G[ \t]/cg) { }
512 19 61 if ($1 eq '\\') { }
19 42 elsif ($1 eq '-') { }
5 37 elsif ($1 eq '[:') { }
513 0 19 unless /\G(.)/cg
515 18 1 if ref $cp
519 18 1 if (@range == 1) { }
528 0 5 unless /\G ( [^:]+ ) :] /cgx
540 0 45 unless /\G(.)/cg
545 16 54 if (not defined $cp) { }
8 46 elsif (@range == 1) { }
17 29 elsif (@range == 2) { }
565 13 24 if (@chars) { }
574 0 0 $_[0] <= 255 ? :
3 0 chr($_[0]) =~ /[\w]/ ? :
582 1 0 if (my $cp = $parse->{'codepoints'})
586 0 1 if (my $r = $parse->{'codepoint_ranges'})
591 0 1 if (my $cl = $parse->{'classes'})
594 0 0 ord $_ == 94 ? :
0 0 $_ eq '\\N' ? :
604 1 748 $_[0]{'members'} ? :
609 6 0 $_[0]{'members'} ? :
615 0 1109 if $ofs < 0
616 0 1109 if $ofs >= $invlist_index->[-1] or $ofs < 0
621 2761 3020 if ($ofs >= $invlist_index->[$mid]) { }
1911 1109 elsif ($mid > 0 and $ofs < $$invlist_index[$mid - 1]) { }
628 1036 73 if $mid > 0
646 2331 3408 if ($mid > 0 and $codepoint < $invlist->[$mid]) { }
2621 787 elsif ($mid < $#$invlist and $codepoint >= $$invlist[$mid + 1]) { }
653 1 786 unless $codepoint >= $invlist->[$mid]
654 8 778 unless $mid > 0
655 765 13 unless $mid & 1
657 2 11 unless wantarray
672 5 0 $invlist->[0] ? :
674 0 5 if (@$invlist & 1 and defined $max_codepoint and $invlist->[-1] == $max_codepoint + 1)
710 0 34 unless @invlists
711 20 14 unless @invlists > 1
719 814 2470 if ($invlists[$i][$pos[$i]] < $min_ch)
724 2 3291 if $min_ch > $max_codepoint
726 3111 180 if (@combined and $combined[-1] >= $min_ch) { }
730 1329 1782 if not defined $new_end or $combined[-1] < $new_end
737 21 3270 if (($pos[$min_i] += 2) >= @{$invlists[$min_i];}) { }
0 3270 elsif (@invlists == 1) { }
741 6 15 unless (defined $combined[-1])
757 1 13 if (1 & @combined and $max_codepoint < 1114111)