Branch Coverage

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


line true false branch
20 7 38 if (@_ == 1 and not ref $_[0])
23 0 7 if (ref $class)
31 24 14 @_ != 1 ? :
34 6 32 if defined $self{'classes'}
35 2 36 if defined $self{'codepoints'}
36 0 38 if defined $self{'codepoint_ranges'}
37 0 38 if defined $self{'negate'}
38 3 35 if (defined $self{'chars'})
42 0 38 if (defined $self{'ranges'})
45 0 0 ref $_ ? :
50 0 38 if (ref $class)
51 0 0 unless (keys %parse or defined $self{'notation'} or $self{'members'} or $self{'member_invlist'})
59 21 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 112 if @_ > 1
119 0 112 if @_ > 1
125 83 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 18 if (@$invlist & 1)
183 0 1605 if (@_ > 1)
198 3 9 if (not defined $max_codepoint or $max_codepoint > 1000 or not defined $self->{'notation'})
207 34 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 20 if (defined(my $cp = $parse->{'codepoints'}))
297 2 3 if ($invlist[-1] == $chars[$i]) { }
306 9 16 if (my $r = $parse->{'codepoint_ranges'})
310 1 9 if (@invlists and $invlists[-1][-1] < $start) { }
0 9 elsif (@invlists and $invlists[-1][0] > $limit) { }
321 11 14 if ($parse->{'classes'})
327 1 24 if ($parse->{'negate'})
328 1 0 if ($invlist->[0]) { }
344 82 30 if (@_)
345 79 3 ref $_[0] eq 'HASH' ? :
346 80 2 @_ ? :
350 85 27 !(defined $cp_min || defined $cp_max) ? :
358 0 1 $_compile ? :
0 80 $_compile ? :
0 2 $_compile ? :
3 26 $_compile ? :
29 0 ref $len eq 'CODE' ? :
2 29 ref $len eq 'ARRAY' ? :
80 31 !ref($len) ? :
1 111 !defined($len) ? :
364 96 16 if ($self->{'members'} or $member_count < 500) { }
371 3 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 31 unless length $notation
412 0 31 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 34 if /\G \^ /cgx
507 0 36 if (/\G]/cg)
511 78 43 if (/\G ( \\ | - | \[: | \] ) /cgx) { }
0 43 elsif ($flags and ($flags->{'x'} || 0) >= 2 and /\G[ \t]/cg) { }
512 19 59 if ($1 eq '\\') { }
18 41 elsif ($1 eq '-') { }
5 36 elsif ($1 eq '[:') { }
513 0 19 unless /\G(.)/cg
515 18 1 if ref $cp
519 17 1 if (@range == 1) { }
528 0 5 unless /\G ( [^:]+ ) :] /cgx
540 0 43 unless /\G(.)/cg
545 16 52 if (not defined $cp) { }
8 44 elsif (@range == 1) { }
16 28 elsif (@range == 2) { }
565 13 23 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 1108 if $ofs < 0
616 0 1108 if $ofs >= $invlist_index->[-1] or $ofs < 0
621 2758 3014 if ($ofs >= $invlist_index->[$mid]) { }
1906 1108 elsif ($mid > 0 and $ofs < $$invlist_index[$mid - 1]) { }
628 1032 76 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 33 unless @invlists
711 19 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)