Branch Coverage

blib/lib/Mock/Data/Charset.pm
Criterion Covered Total %
branch 179 242 73.9


line true false branch
20 7 37 if (@_ == 1 and not ref $_[0])
23 0 7 if (ref $class)
31 23 14 @_ != 1 ? :
34 6 31 if defined $self{'classes'}
35 2 35 if defined $self{'codepoints'}
36 0 37 if defined $self{'codepoint_ranges'}
37 0 37 if defined $self{'negate'}
38 3 34 if (defined $self{'chars'})
42 0 37 if (defined $self{'ranges'})
45 0 0 ref $_ ? :
50 0 37 if (ref $class)
51 0 0 unless (keys %parse or defined $self{'notation'} or $self{'members'} or $self{'member_invlist'})
59 20 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 15 11 unless ($_[0]{'_parse'})
82 15 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 84 778 $_[0]{'members'} ? :
138 20 0 if (@$invlist > 1)
143 0 20 if 1 & @$invlist
151 5 1 if (@$invlist > 1)
156 2 4 if 1 & @$invlist
175 6 17 if (@$invlist & 1)
183 0 1604 if (@_ > 1)
198 3 8 if (not defined $max_codepoint or $max_codepoint > 1000 or not defined $self->{'notation'})
207 33 0 if ('Internals'->can('SvREADONLY'))
220 1373 36 unless $match xor chr($_) =~ /$re/
226 4 4 if ($max_codepoint < 1114111 and 1 & @invlist)
236 5 20 if (defined(my $cp = $parse->{'codepoints'}))
242 2 3 if ($invlist[-1] == $chars[$i]) { }
251 9 16 if (my $r = $parse->{'codepoint_ranges'})
255 1 9 if (@invlists and $invlists[-1][-1] < $start) { }
0 9 elsif (@invlists and $invlists[-1][0] > $limit) { }
266 11 14 if ($parse->{'classes'})
272 1 24 if ($parse->{'negate'})
273 1 0 if ($invlist->[0]) { }
289 82 31 if (@_)
290 79 3 ref $_[0] eq 'HASH' ? :
291 80 2 @_ ? :
295 86 27 !(defined $cp_min || defined $cp_max) ? :
303 0 1 $_compile ? :
0 80 $_compile ? :
0 2 $_compile ? :
3 27 $_compile ? :
30 0 ref $len eq 'CODE' ? :
2 30 ref $len eq 'ARRAY' ? :
80 32 !ref($len) ? :
1 112 !defined($len) ? :
309 97 16 if ($self->{'members'} or $member_count < 500) { }
316 3 94 if $_compile
329 0 16 if $_compile
341 21 6 !defined($cp_min) ? :
346 0 27 !defined($cp_max) ? :
348 17 10 defined $at ? :
356 0 31 unless length $notation
357 0 31 if $notation eq '^'
413 5 17 if (ord $class == 94)
419 2 13 unless defined $have_prop_invlist
421 15 0 $have_prop_invlist ? :
426 0 3 unless /\G( [0-9A-Fa-f]{2} | \{ ([0-9A-Fa-f]+) \} )/cgx
428 1 2 defined $2 ? :
432 0 5 unless /\G( [0-7]{3} | 0 | o\{ ([0-7]+) \} ) /cgx
434 1 4 defined $2 ? :
438 2 0 if /\G \{ ([^}]+) \} /cgx
447 0 7 unless /\G \{ ([^}]+) \} /cgx
449 4 3 $negate ? :
458 2 34 if /\G \^ /cgx
459 0 36 if (/\G]/cg)
463 78 43 if (/\G ( \\ | - | \[: | \] ) /cgx) { }
0 43 elsif ($flags and ($flags->{'x'} || 0) >= 2 and /\G[ \t]/cg) { }
464 19 59 if ($1 eq '\\') { }
18 41 elsif ($1 eq '-') { }
5 36 elsif ($1 eq '[:') { }
465 0 19 unless /\G(.)/cg
467 18 1 if ref $cp
471 17 1 if (@range == 1) { }
480 0 5 unless /\G ( [^:]+ ) :] /cgx
492 0 43 unless /\G(.)/cg
497 16 52 if (not defined $cp) { }
8 44 elsif (@range == 1) { }
16 28 elsif (@range == 2) { }
517 13 23 if (@chars) { }
526 0 0 $_[0] <= 255 ? :
3 0 chr($_[0]) =~ /[\w]/ ? :
534 1 0 if (my $cp = $parse->{'codepoints'})
538 0 1 if (my $r = $parse->{'codepoint_ranges'})
543 0 1 if (my $cl = $parse->{'classes'})
546 0 0 ord $_ == 94 ? :
0 0 $_ eq '\\N' ? :
556 1 748 $_[0]{'members'} ? :
561 6 0 $_[0]{'members'} ? :
567 0 1080 if $ofs < 0
568 0 1080 if $ofs >= $invlist_index->[-1] or $ofs < 0
573 2631 2977 if ($ofs >= $invlist_index->[$mid]) { }
1897 1080 elsif ($mid > 0 and $ofs < $$invlist_index[$mid - 1]) { }
580 1006 74 if $mid > 0
598 2341 3408 if ($mid > 0 and $codepoint < $invlist->[$mid]) { }
2621 787 elsif ($mid < $#$invlist and $codepoint >= $$invlist[$mid + 1]) { }
605 1 786 unless $codepoint >= $invlist->[$mid]
606 8 778 unless $mid > 0
607 765 13 unless $mid & 1
609 2 11 unless wantarray
624 5 0 $invlist->[0] ? :
626 0 5 if (@$invlist & 1 and defined $max_codepoint and $invlist->[-1] == $max_codepoint + 1)
662 0 33 unless @invlists
663 19 14 unless @invlists > 1
671 814 2470 if ($invlists[$i][$pos[$i]] < $min_ch)
676 2 3291 if $min_ch > $max_codepoint
678 3111 180 if (@combined and $combined[-1] >= $min_ch) { }
682 1329 1782 if not defined $new_end or $combined[-1] < $new_end
689 21 3270 if (($pos[$min_i] += 2) >= @{$invlists[$min_i];}) { }
0 3270 elsif (@invlists == 1) { }
693 6 15 unless (defined $combined[-1])
709 1 13 if (1 & @combined and $max_codepoint < 1114111)