Branch Coverage

lib/DateTime/Format/JP.pm
Criterion Covered Total %
branch 229 502 45.6


line true false branch
417 0 85 if @_ % 2
424 0 85 if (exists $p->{'hankaku'} and not exists $p->{'zenkaku'})
434 0 0 if (@_)
436 0 0 ref $_ eq 'CODE' ? :
437 0 0 if warnings::enabled()
440 0 0 ref $self ? :
448 0 83 if not ref $dt or ref $dt and not $dt->isa("DateTime")
449 83 0 length $self->{'pattern'} ? :
456 3 45 if ref $_[0] eq "HASH"
457 45 3 unless exists $opts->{'simple_kanji'}
460 20 28 if ($self->{'zenkaku'}) { }
8 20 elsif ($self->{'kanji_number'}) { }
466 1 7 if ($opts->{'simple_kanji'}) { }
481 3 6 if ref $_[0] eq "HASH"
482 6 3 unless exists $opts->{'simple_kanji'}
485 4 5 if ($self->{'zenkaku'}) { }
1 4 elsif ($self->{'kanji_number'}) { }
491 1 0 if ($opts->{'simple_kanji'}) { }
505 0 0 $self->{'traditional'} || $self->{'zenkaku'} || $self->{'kanji_number'} ? :
543 12 18 if ($self->{'zenkaku'}) { }
6 12 elsif ($self->{'kanji_number'}) { }
552 3 2 if ($self->{'traditional'} or $self->{'kanji_number'}) { }
557 3 0 $dt->hour > 12 ? :
561 1 1 $self->{'zenkaku'} ? :
562 2 0 $dt->hour > 12 ? :
581 3 6 if ($self->{'zenkaku'}) { }
3 3 elsif ($self->{'kanji_number'}) { }
609 2 4 if ($self->{'zenkaku'}) { }
2 2 elsif ($self->{'kanji_number'}) { }
619 1 2 if ($self->{'zenkaku'}) { }
1 1 elsif ($self->{'kanji_number'}) { }
635 3 2 $self->{'traditional'} || $self->{'kanji_number'} ? :
643 3 2 $self->{'traditional'} || $self->{'kanji_number'} ? :
647 2 0 $dt->hour > 12 ? :
649 2 0 $dt->hour > 12 ? :
1 1 $self->{'zenkaku'} ? :
1 1 $self->{'zenkaku'} ? :
651 1 1 $self->{'zenkaku'} ? :
653 1 1 $self->{'zenkaku'} ? :
655 3 2 $self->{'traditional'} || $self->{'kanji_number'} ? :
659 1 1 $self->{'zenkaku'} ? :
1 1 $self->{'zenkaku'} ? :
683 3 6 if ($self->{'zenkaku'}) { }
3 3 elsif ($self->{'kanji_number'}) { }
706 4 0 $dt->hour > 12 ? :
708 2 2 if ($self->{'traditional'} or $self->{'kanji_number'}) { }
1 1 elsif ($self->{'zenkaku'}) { }
722 3 9 if ($self->{'zenkaku'}) { }
3 6 elsif ($self->{'kanji_number'}) { }
732 2 2 if ($self->{'traditional'} or $self->{'kanji_number'}) { }
746 1 2 if ($self->{'zenkaku'}) { }
1 1 elsif ($self->{'kanji_number'}) { }
762 1 1 if ($self->{'zenkaku'} or $self->{'traditional'} or $self->{'kanji_number'})
764 2 0 if (substr($rv, 0, 1) eq '+') { }
0 0 elsif (substr($rv, 0, 1) eq '-') { }
786 0 83 unless exists $map->{$token}
790 0 83 if (index($pat, "%") != -1)
805 0 116 unless defined $num and length $num
808 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}//)
813 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}//)
818 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}//)
823 101 15 if (length $num)
839 44 10604 if ($ref->{'name'} eq $name)
853 0 15 if not ref $dt or ref $dt and not $dt->isa("DateTime")
859 3615 15 if scalar @{$def->{'end'};} and $y > $def->{'end'}[0]
860 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]) { }
891 0 78 if ref $opts ne "HASH"
894 0 234 unless length $opts->{$_}
896 15 63 if (length $opts->{'ampm'} and $opts->{'ampm'} eq "\x{5348}\x{5f8c}")
901 0 78 if ($INC{'threads.pm'} and not exists $INC{'forks.pm'})
904 44 34 if ($opts->{'era'} and ref $opts->{'era'}) { }
908 44 0 if $opts->{'year'} > 1
920 0 34 if (length $opts->{'time_zone'}) { }
0 34 elsif (length $self->{'time_zone'}) { }
931 66 12 if $opts->{'hour'}
932 47 31 if $opts->{'minute'}
933 15 63 if $opts->{'second'}
936 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 and not !length([caller]->[1]) && [caller 1]->[3] eq '(eval)')
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)
939 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 ? :
946 768 0 if $self->{'debug'} < int $level
947 0 0 ref $_ eq 'CODE' ? :
959 53 25 if ($str =~ /$DateTime::Format::JP::DATETIME_PATTERN_1_RE/x) { }
0 25 elsif ($str =~ /$DateTime::Format::JP::DATETIME_PATTERN_2_RE/x) { }
25 0 elsif ($str =~ /$DateTime::Format::JP::DATETIME_PATTERN_3_RE/x) { }
963 29 24 if ($re->{'era'}) { }
975 109 50 if $re->{$_} =~ /^[0-9]+$/
978 0 50 unless defined $rv
983 127 32 if not length $re->{$_} or $re->{$_} =~ /^[0-9]+$/
986 0 32 unless defined $rv
997 0 0 if ($re->{'era'}) { }
1016 15 10 if ($re->{'era'}) { }
1030 0 75 unless defined $rv
1035 34 41 unless length $re->{$_}
1038 0 41 unless defined $rv
1054 0 40 unless defined $num and length $num
1059 6 34 if ($num =~ s/^(\d)(\d{3})$/$2/)
1062 5 1 $1 > 1 ? :
1066 39 1 unless (not length $num or $num =~ /^0+$/)
1068 7 32 if ($num =~ s/^(\d)(\d{2})$/$2/)
1071 5 2 $1 > 1 ? :
1075 38 1 unless (not length $num or $num =~ /^0+$/)
1077 22 16 if ($num =~ s/^(\d)(\d)$/$2/)
1080 11 11 $1 > 1 ? :
1082 7 31 if $num == 0
1085 31 7 unless (not length $num or $num =~ /^0+$/)
1098 0 3 unless defined $num and length $num
1102 1 12 unless ($_ =~ /^[0-9]$/)
1118 0 63 if $num =~ /^[\x{ff10}\x{ff11}\x{ff12}\x{ff13}\x{ff14}\x{ff15}\x{ff16}\x{ff17}\x{ff18}\x{ff19}]+$/
1122 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]$/) { }
1132 0 1 if warnings::enabled()
1151 53 0 unless $self->{'debug'}
1166 0 208 if ref $array ne "ARRAY"
1167 0 208 unless scalar @$array
1168 0 208 unless defined $num and length $num
1171 168 40 if length $index1
1172 168 40 if length $index1
1176 0 80 if ($c =~ /^[0-9]$/)
1183 0 80 unless length $index
1194 0 0 if (@_)
1205 0 0 if (@_)
1209 0 0 if ($field eq 'zenkaku') { }
0 0 elsif ($field eq 'hankaku') { }
1238 0 2 $@ ? :
1247 0 0 if (@_)
1249 0 0 ref $_ eq 'CODE' ? :
1250 0 0 if warnings::enabled()
1253 0 0 ref $self ? :
1282 0 44 if ($INC{'threads.pm'} and not exists $INC{'forks.pm'})
1284 44 0 if (ref $ref eq 'ARRAY' and scalar @$ref == 3) { }
1297 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 and not !length([caller]->[1]) && [caller 1]->[3] eq '(eval)')
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)
1300 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 ? :