Branch Coverage

blib/lib/Unicode/Japanese.pm
Criterion Covered Total %
branch 293 448 65.4


line true false branch
39 0 22 grep({$_ eq ':all';} @_) ? :
42 0 3 if $_ eq 'PurePerl'
43 0 3 if ($exp{$_} or $exp{'&' . $_}) { }
3 0 elsif ($_ eq 'no_I18N_Japanese') { }
59 0 22 if (@na)
81 0 21 if ($Unicode::Japanese::PurePerl)
105 0 21 if ($@)
124 0 21 if ($@)
134 0 21 if ($@)
139 0 21 unless ($use_xs)
148 21 0 if not defined $Unicode::Japanese::xs_loaderror
173 233 0 if (defined $pkg) { }
183 194 39 if @_
211 21 118 unless (defined $Unicode::Japanese::xs_loaderror)
214 0 21 if (defined &$Unicode::Japanese::AUTOLOAD)
220 0 139 unless my($pkg, $subname) = do { local($1, $2); $Unicode::Japanese::AUTOLOAD =~ /^(.*)::(\w+)$/ }
227 115 24 unless (defined &$ppsubname)
370 0 57 unless my($pkg, $subname) = do { local($1, $2); $Unicode::Japanese::PurePerl::AUTOLOAD =~ /^(.*)::(\w+)$/ }
390 0 172 unless my($subpkg, $subname) = $fullsubname =~ /^(.*)::(\w+)$/
394 0 172 unless (defined $Unicode::Japanese::PurePerl::TABLE->{$subname}{'offset'})
397 0 0 unless (defined $Unicode::Japanese::PurePerl::TABLE->{$subname}{'offset'})
399 0 0 if ($subname eq 'DESTROY')
412 0 172 if ($Unicode::Japanese::PurePerl::TABLE->{$subname}{'offset'} == -1)
417 0 172 unless seek $Unicode::Japanese::PurePerl::FH, $Unicode::Japanese::PurePerl::PROGLEN + $Unicode::Japanese::PurePerl::HEADLEN + $Unicode::Japanese::PurePerl::TABLE->{$subname}{'offset'}, 0
421 0 172 unless read $Unicode::Japanese::PurePerl::FH, $sub, $Unicode::Japanese::PurePerl::TABLE->{$subname}{'length'}
424 172 0 if ($] >= 5.008)
429 64 213 if defined $str
17 230 if (ref $str)
0 227 if (ref $icode)
57 217 if (ref $encode)
22 204 if ($] >= 5.008)
20 210 if ($encode eq 'base64') { }
4 207 if (defined $encode)
3 110 if ($icode eq 'unknown')
62 90 if ($icode eq 'auto')
110 49 if ($icode eq 'utf8') { }
73 37 elsif ($icode eq 'ucs2') { }
3 102 elsif ($icode eq 'ucs4') { }
1 107 elsif ($icode eq 'utf16-be') { }
11 99 elsif ($icode eq 'utf16-le') { }
21 84 elsif ($icode eq 'utf16') { }
2 76 elsif ($icode eq 'utf32-be') { }
2 74 elsif ($icode eq 'utf32-le') { }
2 63 elsif ($icode eq 'utf32') { }
8 4 elsif ($icode eq 'jis') { }
5 3 elsif ($icode eq 'euc' or $icode eq 'euc-jp') { }
4 6 elsif ($icode eq 'sjis' or $icode eq 'cp932') { }
0 9 elsif ($icode eq 'sjis-imode') { }
5 57 elsif ($icode eq 'sjis-imode1') { }
50 8 elsif ($icode eq 'sjis-imode2') { }
51 7 elsif ($icode eq 'sjis-doti') { }
5 55 elsif ($icode eq 'sjis-doti1') { }
1 52 elsif ($icode eq 'sjis-jsky') { }
0 52 elsif ($icode eq 'sjis-jsky1') { }
1 52 elsif ($icode eq 'sjis-jsky2') { }
3 55 elsif ($icode eq 'jis-jsky') { }
1 57 elsif ($icode eq 'jis-jsky1') { }
6 56 elsif ($icode eq 'jis-jsky2') { }
43 272 elsif ($icode eq 'utf8-jsky') { }
3 6 elsif ($icode eq 'utf8-jsky1') { }
8 8 elsif ($icode eq 'utf8-jsky2') { }
0 7 elsif ($icode eq 'jis-au') { }
0 51 elsif ($icode eq 'jis-au1') { }
50 1 elsif ($icode eq 'jis-au2') { }
59 3 elsif ($icode eq 'sjis-au') { }
9 56 elsif ($icode eq 'sjis-au1') { }
1 62 elsif ($icode eq 'sjis-au2') { }
7 58 elsif ($icode eq 'sjis-icon-au') { }
3 59 elsif ($icode eq 'sjis-icon-au1') { }
3 97 elsif ($icode eq 'sjis-icon-au2') { }
6 91 elsif ($icode eq 'euc-icon-au') { }
0 42 elsif ($icode eq 'euc-icon-au1') { }
0 25 elsif ($icode eq 'euc-icon-au2') { }
0 25 elsif ($icode eq 'jis-icon-au') { }
3 24 elsif ($icode eq 'jis-icon-au1') { }
0 2 elsif ($icode eq 'jis-icon-au2') { }
0 2 elsif ($icode eq 'utf8-icon-au') { }
2 1 elsif ($icode eq 'utf8-icon-au1') { }
0 8 elsif ($icode eq 'utf8-icon-au2') { }
1 32 elsif ($icode eq 'ascii') { }
26 7 elsif ($icode eq 'binary') { }
25 0 if (not defined $icode) { }
0 25 unless (defined $str)
0 25 unless (defined $Unicode::Japanese::PurePerl::s2u_table)
2 25 unless (defined $Unicode::Japanese::PurePerl::ej2u1)
0 27 $l < 128 ? :
0 29 $l >= 57344 && $l <= 65535 ? :
2 33 $l >= 33024 && $l <= 40959 ? :
1 26 $l >= 161 && $l <= 223 ? :
0 0 length $1 <= 2 ? :
0 0 unless (defined $str)
0 0 unless (defined $Unicode::Japanese::PurePerl::s2u_table)
0 0 unless (defined $Unicode::Japanese::PurePerl::ej2u1)
0 27 unless (defined $Unicode::Japanese::PurePerl::ej2u2)
27 0 $l < 128 ? :
27 0 $l >= 57344 && $l <= 65535 ? :
0 27 $l >= 33024 && $l <= 40959 ? :
0 27 $l >= 161 && $l <= 223 ? :
0 27 $l =~ s/^$Unicode::Japanese::PurePerl::RE{'E_JSKY_START'}($Unicode::Japanese::PurePerl::RE{'E_JSKY1v1'})//o ? :
0 27 length $1 <= 2 ? :
0 30 if ($] >= 5.008)
1 29 if ($l % 4 == 0 and $str =~ /^(?:$Unicode::Japanese::PurePerl::RE{'BOM4_BE'}|$Unicode::Japanese::PurePerl::RE{'BOM4_LE'})/o)
1 29 if ($l % 2 == 0 and $str =~ /^(?:$Unicode::Japanese::PurePerl::RE{'BOM2_BE'}|$Unicode::Japanese::PurePerl::RE{'BOM2_LE'})/o)
0 0 if ($str2 eq '')
0 0 if ($str2 eq '')
0 0 if ($l % 4 == 0)
0 0 unless ($str =~ /[\e\x80-\xff]/)
0 30 if ($str =~ /(?:$Unicode::Japanese::PurePerl::RE{'JIS_0208'})(?:[^\e]{2})*$Unicode::Japanese::PurePerl::RE{'E_JIS_AU'}/o) { }
30 0 elsif ($str =~ /(?:$Unicode::Japanese::PurePerl::RE{'E_JSKY'})/o) { }
30 0 if ($str =~ /$Unicode::Japanese::PurePerl::RE{'JIS_0208'}|$Unicode::Japanese::PurePerl::RE{'JIS_0212'}|$Unicode::Japanese::PurePerl::RE{'JIS_ASC'}|$Unicode::Japanese::PurePerl::RE{'JIS_KANA'}/o)
0 30 if ($str =~ /(?:$Unicode::Japanese::PurePerl::RE{'E_JSKY'})/o)
0 30 if ($str2 eq '')
0 30 if ($str2 eq '')
0 30 if ($str =~ /^(?:$Unicode::Japanese::PurePerl::RE{'E_SJIS_AU'})/o)
0 27 if ($str3 eq '')
0 27 if ($str3 eq '')
1 26 if ($str2 eq '')
0 0 unless (defined $Unicode::Japanese::PurePerl::eu2j2)
0 0 if $c eq ''
0 0 if ($c =~ /^\e\$([GEFOPQ])(.)\x0f/)
0 0 if (1040384 <= $ch and $ch <= 1048575) { }
0 27 unless (defined $str)
27 0 $uc < 2048 ? :
27 0 $uc < 128 ? :
0 27 $Unicode::Japanese::PurePerl::U2T[$uc] ? :
0 27 unless (defined $str)
0 27 unless (defined $Unicode::Japanese::PurePerl::s2u_table)
0 27 unless (defined $Unicode::Japanese::PurePerl::ej2u1)
0 30 unless (defined $Unicode::Japanese::PurePerl::ej2u2)
0 30 unless (defined $str)
1 29 $ch < 128 ? :
0 0 $ch < 2048 ? :
0 0 length $1 == 3 ? :
0 0 length $1 == 2 ? :
0 0 length $1 == 1 ? :
0 30 defined $2 ? :
30 0 unless defined $2 ? "\000?" : $Unicode::Japanese::PurePerl::T2U{$1}
30 0 unless (defined $str)
0 30 unless (defined $Unicode::Japanese::PurePerl::ea2u1)
0 30 $c eq '' ? :
0 30 $1 > 0 && $1 <= 330 ? :
0 30 unless (defined $str)
0 8 unless (defined $Unicode::Japanese::PurePerl::ea2u2)
0 0 $c eq '' ? :
8 0 $1 > 0 && $1 <= 822 ? :
0 8 unless $Unicode::Japanese::PurePerl::J2S[unpack 'n', $1]
0 8 if ($esc =~ /^$Unicode::Japanese::PurePerl::RE{'JIS_0208'}/)
0 8 if ($esc eq $Unicode::Japanese::PurePerl::ESC{'JIS_0212'}) { }
0 82 elsif (not $esc =~ /^$Unicode::Japanese::PurePerl::RE{'JIS_ASC'}/) { }
0 2 $c1 < 223 ? :
0 2 $c1 < 223 ? :
70 2 if ($c1 % 2) { }
72 4 if ($esc =~ /^$Unicode::Japanese::PurePerl::RE{'JIS_0208'}/)
2 76 if ($esc eq $Unicode::Japanese::PurePerl::ESC{'JIS_0212'}) { }
2 78 elsif (not $esc =~ /^$Unicode::Japanese::PurePerl::RE{'JIS_ASC'}/) { }
2 80 $c1 < 223 ? :
0 82 $c1 < 223 ? :
0 17 if ($c1 % 2) { }
0 17 if $c1 == 235
0 17 if $c1 == 236
1 16 if $c1 == 237
1 15 if $c1 == 238
0 15 unless $Unicode::Japanese::PurePerl::S2J[unpack 'n', $1]
1 14 if ($s =~ /^$Unicode::Japanese::PurePerl::RE{'SJIS_KANA'}/o) { }
1 13 $c1 >= 224 ? :
1 12 $c1 >= 224 ? :
0 12 if (159 <= $c2) { }
0 12 unless (defined $str)
1 11 unless (defined $Unicode::Japanese::PurePerl::s2u_table)
1 10 $l < 128 ? :
0 10 $l >= 57344 && $l <= 64767 ? :
1 9 $l >= 33024 && $l <= 40959 ? :
1 8 $l >= 161 && $l <= 223 ? :
0 8 unless $Unicode::Japanese::PurePerl::S2U{$1}
0 8 if ($s =~ /^$Unicode::Japanese::PurePerl::RE{'SJIS_KANA'}/o) { }
0 8 if $c1 == 246
0 8 if $c1 == 247
1 7 if $c1 == 243
1 6 if $c1 == 244
0 6 $c1 >= 224 ? :
1 5 $c1 >= 224 ? :
1 4 if (159 <= $c2) { }
0 4 unless (defined $str)
1 3 unless (defined $Unicode::Japanese::PurePerl::s2u_table)
1 2 unless (defined $Unicode::Japanese::PurePerl::ea2u1s)
0 2 $l < 128 ? :
1 1 $l >= 57344 && $l <= 64767 ? :
1 0 $l >= 60160 && $l <= 61183 ? :
0 0 $l >= 33024 && $l <= 40959 ? :
0 0 $l >= 161 && $l <= 223 ? :
0 0 unless $Unicode::Japanese::PurePerl::SA2U1{$1}
0 0 unless (defined $str)
0 0 unless (defined $Unicode::Japanese::PurePerl::s2u_table)
0 0 unless (defined $Unicode::Japanese::PurePerl::ea2u2s)
0 0 $l < 128 ? :
0 0 $l >= 57344 && $l <= 64767 ? :
0 0 $l >= 60160 && $l <= 61183 ? :
0 0 $l >= 33024 && $l <= 40959 ? :
0 0 $l >= 161 && $l <= 223 ? :
0 17 unless $Unicode::Japanese::PurePerl::SA2U2{$1}
430 3 169 if ($@)
475 28 529 if (not defined $Unicode::Japanese::PurePerl::HEADLEN)
482 131 317 if ($INC{$file})
484 100 32 unless open $Unicode::Japanese::PurePerl::FH, $INC{$file}
491 15 419 if (-f "$mypath/$file")
493 3 439 unless open $Unicode::Japanese::PurePerl::FH, "$mypath/$file"
505 333 32151 if $line =~ /^__DATA__/
509 3 41 unless read $Unicode::Japanese::PurePerl::FH, $Unicode::Japanese::PurePerl::HEADLEN, 4
512 14 426 unless read $Unicode::Japanese::PurePerl::FH, $Unicode::Japanese::PurePerl::TABLE, $Unicode::Japanese::PurePerl::HEADLEN
516 13 117 if ($@)
520 1 324 unless (defined $Unicode::Japanese::PurePerl::TABLE)
540 36 388 unless exists $Unicode::Japanese::PurePerl::TABLE->{$file}
545 15 378 unless seek $Unicode::Japanese::PurePerl::FH, $Unicode::Japanese::PurePerl::PROGLEN + $Unicode::Japanese::PurePerl::HEADLEN + $Unicode::Japanese::PurePerl::TABLE->{$file}{'offset'}, 0
549 5 356 unless read $Unicode::Japanese::PurePerl::FH, $data, $Unicode::Japanese::PurePerl::TABLE->{$file}{'length'}
562 9 295 if (@_) { }
567 2 321 if $_ eq 're'
568 12 309 if $_ eq 'tr'
569 77 232 if $_ eq 'format'
570 20 238 if $_ eq 'string'
586 57 207 if (@_) { }
591 23 328 if $_ eq 're'
592 5 276 if $_ eq 'tr'
593 29 199 if $_ eq 'format'
594 87 192 if $_ eq 'string'