Branch Coverage

lib/DateTime/Format/JP.pm
Criterion Covered Total %
branch 228 500 45.6


line true false branch
410 0 85 if @_ % 2
417 0 85 if (exists $p->{'hankaku'} and not exists $p->{'zenkaku'})
427 0 0 if (@_)
429 0 0 ref $_ eq 'CODE' ? :
430 0 0 if warnings::enabled()
433 0 0 ref $self ? :
441 0 83 if not ref $dt or ref $dt and not $dt->isa('DateTime')
442 83 0 length $self->{'pattern'} ? :
449 3 45 if ref $_[0] eq 'HASH'
450 45 3 unless exists $opts->{'simple_kanji'}
453 20 28 if ($self->{'zenkaku'}) { }
8 20 elsif ($self->{'kanji_number'}) { }
459 1 7 if ($opts->{'simple_kanji'}) { }
474 3 6 if ref $_[0] eq 'HASH'
475 6 3 unless exists $opts->{'simple_kanji'}
478 4 5 if ($self->{'zenkaku'}) { }
1 4 elsif ($self->{'kanji_number'}) { }
484 1 0 if ($opts->{'simple_kanji'}) { }
498 0 0 $self->{'traditional'} || $self->{'zenkaku'} || $self->{'kanji_number'} ? :
536 12 18 if ($self->{'zenkaku'}) { }
6 12 elsif ($self->{'kanji_number'}) { }
545 3 2 if ($self->{'traditional'} or $self->{'kanji_number'}) { }
550 3 0 $dt->hour > 12 ? :
554 1 1 $self->{'zenkaku'} ? :
555 2 0 $dt->hour > 12 ? :
574 3 6 if ($self->{'zenkaku'}) { }
3 3 elsif ($self->{'kanji_number'}) { }
602 2 4 if ($self->{'zenkaku'}) { }
2 2 elsif ($self->{'kanji_number'}) { }
612 1 2 if ($self->{'zenkaku'}) { }
1 1 elsif ($self->{'kanji_number'}) { }
628 3 2 $self->{'traditional'} || $self->{'kanji_number'} ? :
636 3 2 $self->{'traditional'} || $self->{'kanji_number'} ? :
640 2 0 $dt->hour > 12 ? :
642 2 0 $dt->hour > 12 ? :
1 1 $self->{'zenkaku'} ? :
1 1 $self->{'zenkaku'} ? :
644 1 1 $self->{'zenkaku'} ? :
646 1 1 $self->{'zenkaku'} ? :
648 3 2 $self->{'traditional'} || $self->{'kanji_number'} ? :
652 1 1 $self->{'zenkaku'} ? :
1 1 $self->{'zenkaku'} ? :
676 3 6 if ($self->{'zenkaku'}) { }
3 3 elsif ($self->{'kanji_number'}) { }
699 4 0 $dt->hour > 12 ? :
701 2 2 if ($self->{'traditional'} or $self->{'kanji_number'}) { }
1 1 elsif ($self->{'zenkaku'}) { }
715 3 9 if ($self->{'zenkaku'}) { }
3 6 elsif ($self->{'kanji_number'}) { }
725 2 2 if ($self->{'traditional'} or $self->{'kanji_number'}) { }
739 1 2 if ($self->{'zenkaku'}) { }
1 1 elsif ($self->{'kanji_number'}) { }
755 1 1 if ($self->{'zenkaku'} or $self->{'traditional'} or $self->{'kanji_number'})
757 2 0 if (substr($rv, 0, 1) eq '+') { }
0 0 elsif (substr($rv, 0, 1) eq '-') { }
779 0 83 unless exists $map->{$token}
783 0 83 if (index($pat, '%') != -1)
798 0 116 unless defined $num and length $num
801 10 106 if ($num =~ s/^[[:blank:]\h]*([\x{3007}\x{4e00}\x{4e8c}\x{4e09}\x{56db}\x{4e94}\x{516d}\x{4e03}\x{516b}\x{4e5d}])\x{5343}//)
806 0 116 if (length $num and $num =~ s/^([\x{3007}\x{4e00}\x{4e8c}\x{4e09}\x{56db}\x{4e94}\x{516d}\x{4e03}\x{516b}\x{4e5d}])\x{767e}//)
811 15 101 if (length $num and $num =~ s/^([\x{3007}\x{4e00}\x{4e8c}\x{4e09}\x{56db}\x{4e94}\x{516d}\x{4e03}\x{516b}\x{4e5d}])\x{5341}//)
816 101 15 if (length $num)
832 44 10604 if ($ref->{'name'} eq $name)
846 0 15 if not ref $dt or ref $dt and not $dt->isa('DateTime')
852 3615 15 if scalar @{$def->{'end'};} and $y > $def->{'end'}[0]
853 0 15 if (scalar @{$def->{'start'};} and scalar @{$def->{'end'};} and $y >= $def->{'start'}[0] and $y <= $def->{'end'}[0] and $m >= $def->{'start'}[1] and $m <= $def->{'end'}[1] and $d >= $def->{'start'}[2] and $d < $def->{'end'}[2]) { }
15 0 elsif (scalar @{$def->{'start'};} and not scalar @{$def->{'end'};} and $y >= $def->{'start'}[0] and $m >= $def->{'start'}[1] and $d >= $def->{'start'}[2]) { }
884 0 78 if ref $opts ne 'HASH'
887 0 234 unless length $opts->{$_}
889 15 63 if (length $opts->{'ampm'} and $opts->{'ampm'} eq "\x{5348}\x{5f8c}")
894 0 78 if ($INC{'threads.pm'} and not exists $INC{'forks.pm'})
897 44 34 if ($opts->{'era'} and ref $opts->{'era'}) { }
901 44 0 if $opts->{'year'} > 1
913 0 34 if (length $opts->{'time_zone'}) { }
0 34 elsif (length $self->{'time_zone'}) { }
924 66 12 if $opts->{'hour'}
925 47 31 if $opts->{'minute'}
926 15 63 if $opts->{'second'}
929 0 0 if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
0 78 if $@
78 0 if (defined $Nice::Try::WANTARRAY and not $Nice::Try::THREADED)
0 0 &$Nice::Try::TRY ? :
0 0 if scalar @Nice::Try::VOID
0 78 if ($Nice::Try::WANT eq 'OBJECT') { }
0 78 elsif ($Nice::Try::WANT eq 'CODE') { }
0 78 elsif ($Nice::Try::WANT eq 'HASH') { }
0 78 elsif ($Nice::Try::WANT eq 'ARRAY') { }
0 78 elsif ($Nice::Try::WANT eq 'REFSCALAR') { }
0 78 elsif ($Nice::Try::WANT eq 'GLOB') { }
0 78 elsif ($Nice::Try::WANT eq 'LIST') { }
0 78 elsif ($Nice::Try::WANT eq 'BOOLEAN') { }
0 78 elsif ($Nice::Try::WANT eq 'VOID') { }
78 0 elsif ($Nice::Try::WANT eq 'SCALAR') { }
0 0 if defined $Nice::Try::LAST_VAL
0 0 if ($Nice::Try::WANTARRAY) { }
0 0 elsif (defined $Nice::Try::WANTARRAY) { }
78 0 if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { }
0 78 length $@ ? :
78 0 unless &Scalar::Util::blessed($@)
0 0 if ($Nice::Try::HAS_CATCH)
0 78 if ($Nice::Try::DIED)
932 0 0 if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
0 0 &$Nice::Try::CATCH ? :
0 0 if scalar @Nice::Try::VOID
0 0 if ($Nice::Try::WANT eq 'OBJECT') { }
0 0 elsif ($Nice::Try::WANT eq 'CODE') { }
0 0 elsif ($Nice::Try::WANT eq 'HASH') { }
0 0 elsif ($Nice::Try::WANT eq 'ARRAY') { }
0 0 elsif ($Nice::Try::WANT eq 'REFSCALAR') { }
0 0 elsif ($Nice::Try::WANT eq 'GLOB') { }
0 0 elsif ($Nice::Try::WANT eq 'LIST') { }
0 0 elsif ($Nice::Try::WANT eq 'BOOLEAN') { }
0 0 elsif ($Nice::Try::WANT eq 'VOID') { }
0 0 elsif ($Nice::Try::WANT eq 'SCALAR') { }
0 0 if ($Nice::Try::WANTARRAY) { }
0 0 elsif (defined $Nice::Try::WANTARRAY) { }
0 0 if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { }
0 0 if (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__NEXT__') { }
0 0 elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__LAST__') { }
0 0 elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__REDO__') { }
0 78 if ($Nice::Try::WANT eq 'LIST') { }
0 78 elsif ($Nice::Try::WANT eq 'VOID') { }
0 78 elsif ($Nice::Try::WANT eq 'OBJECT') { }
0 78 elsif ($Nice::Try::WANT eq 'REFSCALAR') { }
78 0 elsif ($Nice::Try::WANT eq 'SCALAR') { }
0 0 elsif ($Nice::Try::WANT eq 'BOOLEAN') { }
0 0 elsif ($Nice::Try::WANT eq 'CODE') { }
0 0 elsif ($Nice::Try::WANT eq 'HASH') { }
0 0 elsif ($Nice::Try::WANT eq 'ARRAY') { }
0 0 elsif ($Nice::Try::WANT eq 'GLOB') { }
0 0 $Nice::Try::WANTARRAY ? :
78 0 if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { }
78 0 unless (defined $Nice::Try::BREAK)
78 0 if (defined $Nice::Try::WANTARRAY and !&Scalar::Util::blessed($Nice::Try::RETVAL[0]) || &Scalar::Util::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL'))
0 0 if ($Nice::Try::BREAK eq 'next') { }
0 0 elsif ($Nice::Try::BREAK eq 'last') { }
0 0 elsif ($Nice::Try::BREAK eq 'redo') { }
0 0 if (defined $Nice::Try::BREAK)
0 0 scalar @Nice::Try::LAST_VAL > 1 ? :
939 768 0 if $self->{'debug'} < int $level
940 0 0 ref $_ eq 'CODE' ? :
952 53 25 if ($str =~ /$DATETIME_PATTERN_1_RE/x) { }
0 25 elsif ($str =~ /$DATETIME_PATTERN_2_RE/x) { }
25 0 elsif ($str =~ /$DATETIME_PATTERN_3_RE/x) { }
956 29 24 if ($re->{'era'}) { }
968 109 50 if $re->{$_} =~ /^[0-9]+$/
971 0 50 unless defined $rv
976 127 32 if not length $re->{$_} or $re->{$_} =~ /^[0-9]+$/
979 0 32 unless defined $rv
990 0 0 if ($re->{'era'}) { }
1009 15 10 if ($re->{'era'}) { }
1023 0 75 unless defined $rv
1028 34 41 unless length $re->{$_}
1031 0 41 unless defined $rv
1047 0 40 unless defined $num and length $num
1052 6 34 if ($num =~ s/^(\d)(\d{3})$/$2/)
1055 5 1 $1 > 1 ? :
1059 39 1 unless (not length $num or $num =~ /^0+$/)
1061 7 32 if ($num =~ s/^(\d)(\d{2})$/$2/)
1064 5 2 $1 > 1 ? :
1068 38 1 unless (not length $num or $num =~ /^0+$/)
1070 22 16 if ($num =~ s/^(\d)(\d)$/$2/)
1073 11 11 $1 > 1 ? :
1075 7 31 if $num == 0
1078 31 7 unless (not length $num or $num =~ /^0+$/)
1091 0 3 unless defined $num and length $num
1095 1 12 unless ($_ =~ /^[0-9]$/)
1111 0 63 if $num =~ /^[\x{ff10}\x{ff11}\x{ff12}\x{ff13}\x{ff14}\x{ff15}\x{ff16}\x{ff17}\x{ff18}\x{ff19}]+$/
1115 0 135 if (/^[\x{ff10}\x{ff11}\x{ff12}\x{ff13}\x{ff14}\x{ff15}\x{ff16}\x{ff17}\x{ff18}\x{ff19}]$/) { }
134 1 elsif (/^[0-9]$/) { }
1125 0 1 if warnings::enabled()
1144 53 0 unless $self->{'debug'}
1159 0 208 if ref $array ne 'ARRAY'
1160 0 208 unless scalar @$array
1161 0 208 unless defined $num and length $num
1164 168 40 if length $index1
1165 168 40 if length $index1
1169 0 80 if ($c =~ /^[0-9]$/)
1176 0 80 unless length $index
1187 0 0 if (@_)
1198 0 0 if (@_)
1202 0 0 if ($field eq 'zenkaku') { }
0 0 elsif ($field eq 'hankaku') { }
1233 0 0 if (@_)
1235 0 0 ref $_ eq 'CODE' ? :
1236 0 0 if warnings::enabled()
1239 0 0 ref $self ? :
1268 0 44 if ($INC{'threads.pm'} and not exists $INC{'forks.pm'})
1270 44 0 if (ref $ref eq 'ARRAY' and scalar @$ref == 3) { }
1283 0 0 if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
0 44 if $@
44 0 if (defined $Nice::Try::WANTARRAY and not $Nice::Try::THREADED)
0 0 &$Nice::Try::TRY ? :
0 0 if scalar @Nice::Try::VOID
0 44 if ($Nice::Try::WANT eq 'OBJECT') { }
0 44 elsif ($Nice::Try::WANT eq 'CODE') { }
0 44 elsif ($Nice::Try::WANT eq 'HASH') { }
0 44 elsif ($Nice::Try::WANT eq 'ARRAY') { }
0 44 elsif ($Nice::Try::WANT eq 'REFSCALAR') { }
0 44 elsif ($Nice::Try::WANT eq 'GLOB') { }
0 44 elsif ($Nice::Try::WANT eq 'LIST') { }
0 44 elsif ($Nice::Try::WANT eq 'BOOLEAN') { }
0 44 elsif ($Nice::Try::WANT eq 'VOID') { }
44 0 elsif ($Nice::Try::WANT eq 'SCALAR') { }
0 0 if defined $Nice::Try::LAST_VAL
0 0 if ($Nice::Try::WANTARRAY) { }
0 0 elsif (defined $Nice::Try::WANTARRAY) { }
44 0 if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { }
0 44 length $@ ? :
44 0 unless &Scalar::Util::blessed($@)
0 0 if ($Nice::Try::HAS_CATCH)
0 44 if ($Nice::Try::DIED)
1286 0 0 if not defined $Nice::Try::WANTARRAY and scalar @Nice::Try::LAST_VAL
0 0 &$Nice::Try::CATCH ? :
0 0 if scalar @Nice::Try::VOID
0 0 if ($Nice::Try::WANT eq 'OBJECT') { }
0 0 elsif ($Nice::Try::WANT eq 'CODE') { }
0 0 elsif ($Nice::Try::WANT eq 'HASH') { }
0 0 elsif ($Nice::Try::WANT eq 'ARRAY') { }
0 0 elsif ($Nice::Try::WANT eq 'REFSCALAR') { }
0 0 elsif ($Nice::Try::WANT eq 'GLOB') { }
0 0 elsif ($Nice::Try::WANT eq 'LIST') { }
0 0 elsif ($Nice::Try::WANT eq 'BOOLEAN') { }
0 0 elsif ($Nice::Try::WANT eq 'VOID') { }
0 0 elsif ($Nice::Try::WANT eq 'SCALAR') { }
0 0 if ($Nice::Try::WANTARRAY) { }
0 0 elsif (defined $Nice::Try::WANTARRAY) { }
0 0 if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { }
0 0 if (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__NEXT__') { }
0 0 elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__LAST__') { }
0 0 elsif (defined $Nice::Try::RETVAL[0] and $Nice::Try::RETVAL[0] eq '__REDO__') { }
0 44 if ($Nice::Try::WANT eq 'LIST') { }
0 44 elsif ($Nice::Try::WANT eq 'VOID') { }
0 44 elsif ($Nice::Try::WANT eq 'OBJECT') { }
0 44 elsif ($Nice::Try::WANT eq 'REFSCALAR') { }
44 0 elsif ($Nice::Try::WANT eq 'SCALAR') { }
0 0 elsif ($Nice::Try::WANT eq 'BOOLEAN') { }
0 0 elsif ($Nice::Try::WANT eq 'CODE') { }
0 0 elsif ($Nice::Try::WANT eq 'HASH') { }
0 0 elsif ($Nice::Try::WANT eq 'ARRAY') { }
0 0 elsif ($Nice::Try::WANT eq 'GLOB') { }
0 0 $Nice::Try::WANTARRAY ? :
44 0 if (defined $Nice::Try::WANT and length $Nice::Try::WANT) { }
44 0 unless (defined $Nice::Try::BREAK)
44 0 if (defined $Nice::Try::WANTARRAY and !&Scalar::Util::blessed($Nice::Try::RETVAL[0]) || &Scalar::Util::blessed($Nice::Try::RETVAL[0]) && !$Nice::Try::RETVAL[0]->isa('Nice::Try::SENTINEL'))
0 0 if ($Nice::Try::BREAK eq 'next') { }
0 0 elsif ($Nice::Try::BREAK eq 'last') { }
0 0 elsif ($Nice::Try::BREAK eq 'redo') { }
0 0 if (defined $Nice::Try::BREAK)
0 0 scalar @Nice::Try::LAST_VAL > 1 ? :