Branch Coverage

blib/lib/Date/EzDate2.pm
Criterion Covered Total %
branch 204 292 69.8


line true false branch
85 0 40 unless tie %tiehash, $class . '::Tie', $time, %opts
159 0 1 unless (defined $level)
167 0 1 if ($level eq 'none') { }
0 1 elsif ($level eq 'stderr') { }
1 0 elsif ($level eq 'croak') { }
0 0 elsif ($level eq 'default') { }
325 16 24 if (UNIVERSAL::isa($time, 'Date::EzDate2')) { }
337 23 0 if (defined $time and not ref $time and $time =~ /\S/s)
360 16 0 if (UNIVERSAL::isa($old, 'Date::EzDate2'))
396 0 98 unless (defined $val)
405 0 98 if $val =~ /$left_brace_rx/
427 17 81 if ($key eq 'dayofmonth') { }
17 64 elsif ($key eq 'year') { }
21 43 elsif ($key eq 'month' or $key eq 'monthnum' or $key eq 'monthlong' or $key eq 'monthshort') { }
6 37 elsif ($key eq 'weekday' or $key eq 'weekdaynum' or $key eq 'weekdayshort' or $key eq 'weekdaylong') { }
3 34 elsif ($key eq 'yearday' or $key eq 'yearday3d') { }
3 31 elsif ($key eq 'hour' or $key eq 'hour2d') { }
3 28 elsif ($key eq 'min' or $key eq 'min2d') { }
3 25 elsif ($key eq 'sec' or $key eq 'sec2d') { }
20 5 elsif ($key eq 'ampm' or $key eq 'ampmlc' or $key eq 'ampmuc') { }
2 3 elsif ($key eq 'ampmhour') { }
2 1 elsif ($key eq 'miltime') { }
1 0 elsif ($key eq 'dmy') { }
439 18 3 unless ($val =~ /^\d+$/is)
447 18 0 if (my $num = $MonthNums{$val}) { }
464 5 1 unless ($val =~ /^\d+$/s)
471 0 5 unless ($val = $WeekDayNums{$val})
479 5 1 unless ($val == $dt->day_of_week)
489 0 3 unless $eztied->integer_check($key, $val)
496 3 0 unless ($current == $val)
510 0 3 unless $eztied->integer_check($key, $val)
520 0 3 unless $eztied->integer_check($key, $val)
530 0 3 unless $eztied->integer_check($key, $val)
542 1 19 if (length $val == 1)
549 0 20 unless ($val eq 'am' or $val eq 'pm')
556 16 4 if ($current < 12) { }
557 1 15 if ($val eq 'am')
561 0 4 if ($val eq 'pm')
566 4 15 if ($val eq 'am') { }
575 0 2 unless $eztied->integer_check($key, $val)
579 2 0 if ($dt->hour >= 12)
589 0 2 unless ($val =~ /^\d{4}$/s)
611 0 1 unless $eztied->integer_check("$key - day", $day)
620 1 0 if (my $num = $MonthNums{$month}) { }
630 0 1 unless $eztied->integer_check("$key - year", $year)
869 0 16 unless (defined $val and $val =~ /^\d+$/s and $val > 0)
871 0 0 defined $val ? :
920 0 23 unless (defined $val)
934 0 23 if ($val =~ /^\d+$/i) { }
0 23 elsif ($relative{lc $val}) { }
952 0 0 if ($val eq 'today' or $val eq 'now')
957 0 0 if ($val eq 'tomorrow')
965 0 0 if ($val eq 'yesterday')
992 0 23 if ($val =~ s[[a-z_]+\s*/\s*[a-z_]+$][]is)
1025 23 0 unless ($opts{'dateonly'})
1030 23 0 unless ($opts{'timeonly'})
1031 23 0 if (length $val)
1037 23 0 unless ($opts{'dateonly'})
1038 22 1 if (length $val and not defined $set{'hour'})
1045 22 0 if defined $hour_new
1046 22 0 if defined $min_new
1047 22 0 if defined $sec_new
1052 0 23 unless (defined $val)
1059 23 0 if (%set)
1096 191 3 if (defined $set->{$key})
1103 91 143 if (defined $offset{$key})
1130 232 470 defined $new ? :
1159 0 23 if ($val =~ s/^([a-z]+) (\d+) (\S+) (\d+)$/$3/) { }
1 22 elsif ($val =~ /^\d+ [a-z]+ \d{4}$/) { }
22 0 elsif ($val =~ s/^([a-z]+) (\d+) (\d+)//) { }
0 0 elsif ($val =~ s/^([a-z]+) (\d+)//) { }
0 0 elsif ($val =~ s/^(\d{4}) (\d+) (\d+)//) { }
0 0 elsif ($val =~ s/^(\d+) (\d+) (\d+)//) { }
1235 0 45 unless (defined $str)
1248 19 26 if ($str =~ s/^(\d+):(\d+):(\d+) (a|p)(m|\b)\s*//) { }
3 23 elsif ($str =~ s/^(\d+):(\d+):(\d+)\s*//) { }
0 23 elsif ($str =~ s/^(\d+):(\d+) (a|p)m?\s*//) { }
0 23 elsif ($str =~ s/^(\d+):(\d+)\s*//) { }
0 23 elsif ($str =~ s/^(\d+) (a|p)m?\b\s*//) { }
0 23 elsif (not $opts{'skipjustdigits'} and $str =~ /^\d+$/) { }
0 23 elsif ($opts{'croakonfail'}) { }
1307 3 16 if ($hour == 12) { }
5 11 elsif ($ampm =~ /^p/) { }
1309 0 3 if ($ampm =~ /^a/)
1345 558 859 if ($el =~ /^\{.*\}$/s)
1388 1565 16 unless $_[0] =~ /^\%\w$/
1428 0 456 unless (defined $val)
1479 62 1199 if (not ref $key and $key =~ /[\{\%]/ and not $key =~ /$pcode/o)
1482 69 1199 if (ref $key)
1488 274 206 if ($el =~ s/\{([^\}]+)\}/$1/ or $el =~ /$pcode/o)
1499 0 480 unless (defined $val)
1512 925 274 unless $opts{'normalized'}
1518 0 1199 if ($key eq 'dt' or $key eq 'datetime')
1533 15 1184 if $key eq 'newline'
1534 15 1169 if $key eq 'tab'
1535 0 1169 if $key eq 'leftbrace'
1536 0 1169 if $key eq 'lb'
1537 0 1169 if $key eq 'rightbrace'
1538 0 1169 if $key eq 'rb'
1539 15 1154 if $key eq 'percent'
1542 75 1079 if ($key =~ s/no(zero|0)//)
1546 66 1013 if ($key eq 'dayofmonth')
1550 30 983 if ($key eq 'dayofmonth2d')
1554 0 983 if ($key =~ /^dayofmonthord(word)?$/)
1556 0 983 if ($key eq 'dayofmonthordnum')
1560 30 953 if ($key eq 'weekdaynum')
1564 0 953 if ($key eq 'weekdaynum2d')
1568 45 908 if ($key =~ /^(weekdayshort|dayofweekshort|dayofweek)$/)
1570 31 877 if ($key =~ /^(weekdaylong|dayofweeklong)$/)
1574 47 830 if ($key eq 'monthshort')
1576 16 814 if ($key eq 'month' or $key eq 'monthlong')
1580 31 783 if ($key eq 'monthnum')
1582 45 738 if ($key eq 'monthnum2d')
1586 16 722 if ($key eq 'yearday')
1588 30 692 if ($key eq 'yearday3d')
1592 48 644 if ($key eq 'year')
1594 45 599 if ($key eq 'year2d')
1598 0 599 if ($key eq 'epoch' or $key eq 'epochsec')
1602 30 569 if ($key =~ /^(is)?leapyear/)
1606 30 539 if ($key eq 'daysinmonth')
1615 1 538 if ($key eq 'dmy')
1623 11 527 if ($key eq 'full')
1638 30 497 if ($key =~ /^mil(itary)?time$/)
1642 0 497 if ($key eq 'iso8601')
1654 15 482 if ($key eq 'hour')
1658 60 422 if ($key eq 'hour2d')
1662 45 377 if ($key eq 'min')
1666 75 302 if ($key eq 'min2d')
1670 60 242 if ($key eq 'sec')
1674 75 167 if ($key eq 'sec2d')
1681 2 165 $dt->hour >= 12 ? :
1684 45 122 if ($key eq 'ampm' or $key eq 'ampmlc')
1688 45 77 if ($key eq 'ampmuc')
1695 2 75 if ($dt->hour == 0 or $dt->hour == 12) { }
0 75 elsif ($dt->hour > 12) { }
1703 60 17 if ($key eq 'ampmhour')
1707 17 0 if ($key eq 'clocktime' or $key eq 'clocktimestrict')
1719 0 0 if ($key eq 'tz')
1724 0 0 if ($key eq 'olson')
1741 0 0 defined $eztied->{'warnings'} ? :
1747 0 0 unless $level
1749 0 0 if ($level == 1)
1770 1352 618 unless ($key =~ /[\{\%]/)
1775 100 1252 if $opts{'strip_no_zero'}
1779 604 1366 if (exists $PCodes{$key})
1783 7 1359 if (exists $eztied->{'formats'}{$key})