Branch Coverage

blib/lib/Unicode/Util.pm
Criterion Covered Total %
branch 68 88 77.2


line true false branch
27 2 59 unless @_
33 2 9 unless @_
35 6 5 if (ref $ref eq 'SCALAR') { }
3 2 elsif (ref $ref eq 'ARRAY') { }
2 0 elsif (ref $ref eq 'HASH') { }
37 2 4 defined $1 ? :
40 1 2 unless @$ref
43 3 2 if ($i < $#{$ref;}) { }
48 1 1 defined $1 ? :
54 1 1 unless $elems
58 1 1 if (++$count < $elems) { }
63 1 0 defined $1 ? :
71 8 9 if wantarray
72 3 6 unless @strings
79 18 8 if (not &looks_like_number($pos) or $pos < 0) { }
1 7 elsif ($pos > (my $length = grapheme_length($str))) { }
86 22 4 if $str =~ / ^ ( \X{$pos} \X*? ) \Q$substr\E /gx
95 18 8 if (not &looks_like_number($pos) or $pos < 0)
99 8 18 if ($pos)
100 5 3 $substr ? :
103 22 4 if $str =~ / ^ ( \X* ) \Q$substr\E /gx
112 4 18 if (@_ == 2) { }
13 5 elsif (@_ == 3) { }
5 0 elsif (@_ == 4) { }
113 2 2 if ($offset >= 0) { }
114 2 0 if $$str =~ / ^ \X{$offset} ( .* ) /x
118 2 0 if $$str =~ / ( \X{0,$abs_offset} ) \z /x
122 12 1 if ($offset >= 0) { }
123 10 2 if ($length >= 0) { }
124 10 0 if $$str =~ / ^ \X{$offset} ( \X{0,$length} ) /x
131 2 0 if $$str =~ / ^ \X{$offset} ( .*? ) \X{$abs_length} \z /x
140 1 0 if ($length >= 0) { }
141 1 0 if $$str =~ / (?= \X{$abs_offset} \z ) ( \X{0,$length} ) /x
148 0 0 if $$str =~ / (?= \X{$abs_offset} \z ) ( .*? ) ( \X{$abs_length} ) /x
157 4 1 if ($offset >= 0) { }
158 4 0 if ($length >= 0) { }
161 4 0 if $$str =~ s/ (?<= ^ .{$codepoint_offset} ) ( \X{0,$length} ) /$replacement/x
170 0 0 if $$str =~ s/ (?<= ^ .{$codepoint_offset} ) ( .*? ) (?= \X{$abs_length} \z ) /$replacement/x
179 1 0 if ($length >= 0) { }
180 1 0 if $$str =~ s/ (?= \X{$abs_offset} \z ) ( \X{0,$length} ) /$replacement/x
187 0 0 if $$str =~ s/ (?= \X{$abs_offset} \z ) ( .*? ) (?= \X{$abs_length} ) /$replacement/x
226 0 2 if ($nf and $nf =~ /^ (?:NF)? K? [CD] $/)
237 3 9 unless ($enc and find_encoding $enc)
241 4 8 if ($nf and $nf =~ /^ (?:NF)? K? [CD] $/)