Branch Coverage

blib/lib/Encode/Mapper.pm
Criterion Covered Total %
branch 116 186 62.3


line true false branch
25 10 3 if @_
31 0 1 unless $option{'silent'}
37 0 158302 unless (defined $_[0] and $_[0] ne '')
41 0 158302 unless (defined $_[1])
46 130977 27325 if (UNIVERSAL::isa($_[1], 'ARRAY')) { }
0 54646 elsif (ref \$_[1] ne 'SCALAR' and not UNIVERSAL::isa($_[1], 'CODE')) { }
47 0 130977 unless (defined $_[1][0])
51 0 130977 unless (ref \$_[1][0] eq 'SCALAR' or UNIVERSAL::isa($_[1][0], 'CODE'))
55 0 130977 unless (defined $_[1][1] and length $_[1][1] < length $_[0])
73 21 6 if $caller eq 'Encode::Mapper'
74 17 10 exists $options{$caller} ? :
79 28 24 if ($opt =~ /^\:/) { }
80 10 18 if $opt eq ':others' and $opt{'others'} = sub { shift(); }
81 10 8 if $opt eq ':silent' and $opt{'silent'} = 1
82 8 0 if $opt eq ':join'
91 24 3 exists $opt{'silent'} ? :
93 1 26 if (defined $opt{'complement'} and UNIVERSAL::isa($opt{'complement'}, 'ARRAY'))
99 3 24 if (defined $opt{'override'} and UNIVERSAL::isa($opt{'override'}, 'ARRAY'))
105 0 27 if (defined $opt{'others'} and not $option{'silent'})
106 0 0 if (UNIVERSAL::isa($opt{'others'}, 'CODE')) { }
115 11 16 unless defined $cls
135 14 1 exists $options{caller 0} ? :
138 11 4 if (UNIVERSAL::isa($_[0], 'ARRAY')) { }
0 4 elsif (UNIVERSAL::isa($_[0], 'HASH')) { }
148 1 14 if (defined $option{'complement'})
154 1 1 unless defined $tree[$q]{$token}
158 1 1 unless defined $tree[$q]
160 1 1 if defined $bell[$q]
168 0 156749 unless verify_rule $_[$i], $_[$i + 1]
173 180502 764599 unless defined $tree[$q]{$token}
177 156240 509 unless defined $tree[$q]
179 0 156749 if $redef{$q}++
184 10 5 if (defined $option{'override'})
190 5170 5180 unless defined $tree[$q]{$token}
194 5150 20 unless defined $tree[$q]
196 0 5170 if $redef{$q}++
203 3283 557 unless (defined $tree[0]{$token})
204 898 2385 if (not defined $option{'others'}) { }
215 2942 898 unless ($q == 0)
216 2458 484 unless (defined $bell[$q])
217 12 2446 if (not defined $option{'others'}) { }
2446 0 elsif (UNIVERSAL::isa($option{'others'}, 'CODE')) { }
241 161435 23681 if (defined $bell[$t]) { }
244 134568 26867 if (UNIVERSAL::isa($bell[$t][0], 'ARRAY'))
272 153642 34416 unless keys %{$tree[$q];}
277 8 188050 if (grep {UNIVERSAL::isa($_, 'CODE');} @{$bell[$q];}) { }
0 188050 elsif (defined $option{'join'}) { }
285 68344 119714 if (@{$bell[$q];} == 1) { }
289 20 119694 if @{$bell[$q];} == 0
313 7 11 if ($$obj{'no_list'}) { }
329 27 359 ref $$obj{'bell'}[$q] eq 'ARRAY' ? :
347 18 0 unless defined $q
349 7 11 if ($$obj{'no_list'}) { }
358 2 11 ref $$obj{'bell'}[$q] eq 'ARRAY' ? :
363 0 18 defined $r ? :
387 0 0 $q == 0 ? :
396 0 0 unless defined $ref
412 0 0 if ($$obj{'no_list'}) { }
420 0 0 if (defined $2) { }
425 0 0 unless $1
428 0 0 $$obj{'bell'}[$q] eq '' ? :
431 0 0 if $q == 0
434 0 0 unless $$obj{'skip'}[$q] == 0
445 0 0 if (defined $2) { }
450 0 0 unless $1
453 0 0 ref $$obj{'bell'}[$q] eq 'ARRAY' ? :
456 0 0 if $q == 0
459 0 0 unless $$obj{'skip'}[$q] == 0
466 0 0 if (defined $ref)
467 0 0 if ref $ref ne 'GLOB'
468 0 0 defined $$return{$_} ? :
480 6 0 exists $options{caller 0} ? :
485 0 6 unless (&Encode::is_utf8($text))
489 0 6 if ($enc)
490 0 0 unless (&Encode::resolve_alias($enc))
498 6 20 if defined $_
0 6 if (not UNIVERSAL::isa($encoder, 'ARRAY') or grep {not $_->isa($cls) if defined $_;} @{$encoder;})
504 4 6 unless defined $mapper
506 4 2 defined $option{'join'} ? :
0 6 defined $$mapper{'join'} ? :
509 6 0 if ($$mapper{'no_code'}) { }
513 0 0 UNIVERSAL::isa($_, 'CODE') ? :
527 3 0 exists $options{caller 0} ? :
532 0 3 unless $enc
534 0 3 unless (&Encode::resolve_alias($enc))
539 9 6 if defined $_
0 3 if (not UNIVERSAL::isa($decoder, 'ARRAY') or grep {not $_->isa($cls) if defined $_;} @{$decoder;})
545 2 7 unless defined $mapper
547 4 3 defined $option{'join'} ? :
0 7 defined $$mapper{'join'} ? :
550 7 0 if ($$mapper{'no_code'}) { }
554 0 0 UNIVERSAL::isa($_, 'CODE') ? :
560 0 3 &Encode::is_utf8($text) ? :