Branch Coverage

blib/lib/DateTime/Format/Flexible.pm
Criterion Covered Total %
branch 86 118 72.8


line true false branch
95 7 17822 if $dt
488 308 6048 if exists $args{'args'}
490 140 6216 if (exists $extra_args{'strip'})
492 54 86 ref $extra_args{'strip'} eq 'ARRAY' ? :
495 192 1 if (ref $strip eq 'Regexp') { }
506 2 6353 if (exists $extra_args{'base'})
523 3808 2547 if ($stripped =~ /(\D)/) { }
525 0 3808 if $ENV{'DFF_DEBUG'}
527 0 3808 if $ENV{'DFF_DEBUG'}
531 0 2547 if $ENV{'DFF_DEBUG'}
536 6355 0 unless $date eq '-infinity'
542 1592 4763 if (my($possible_year, $remaining) = $date =~ /\A(\d\d)($DELIM.+)/mx)
544 8 1584 if ($possible_year > 31)
551 21 6334 if ($extra_args{'european'})
553 11 10 if (my($m, $d, $y) = $date =~ /\A$MMDDYYYY/mx)
559 0 6355 if $ENV{'DFF_DEBUG'}
569 10 47 if ($date =~ /$abbrev/)
583 3 6342 if (my($tz) = $date =~ /\s(GMT(?:\+0)?|UTC)\s/mx)
591 10 6332 if ($date =~ /Z\z/mx)
599 2249 4083 if (my($tz) = $date =~ /.+\s+(\D[^\s]+)\z/)
601 0 2249 if $ENV{'DFF_DEBUG'}
603 0 2249 if (exists $extra_args->{'tz_map'}{$tz})
607 681 1568 if ('DateTime::TimeZone'->is_valid_name($tz))
609 0 681 if $ENV{'DFF_DEBUG'}
617 24 5627 if (my($tz) = $date =~ /( (?:\s+)?\+\d{2,4} # ' +04', '+04' |\s+\-\d{4} # ' -0400' |(?:\s+)?[-+]\d{2}:\d{2} # '-04:00', '+04:00' )\.?\z/mx)
623 0 24 if $ENV{'DFF_DEBUG'}
628 18 6 if length $tz == 3
629 24 0 if (_is_valid_tz_offset($tz))
631 0 24 if $ENV{'DFF_DEBUG'}
638 2616 783 if (length $date > 15 and $date =~ /\dT\d/ || $date =~ /\d\s\d/)
643 20 2596 if (my($tz) = $date =~ /( (?:\s+)?[-+]\d{2,4} # '-0800', '-08', ' -08' )\.?\z/mx)
647 0 20 if $ENV{'DFF_DEBUG'}
652 18 2 if length $tz == 3
653 18 2 if (_is_valid_tz_offset($tz))
665 6 5603 if (my($tz) = $date =~ /\s( [-+]\d{4} # Mon Apr 05 17:25:35 +0000 2010 |[-+]\d{2}:\d{2} # Mon Apr 05 17:25:35 +00:00 2010 )\s/mx)
672 6 0 if (_is_valid_tz_offset($tz))
735 0 0 if ($string =~ /ago/mx)
738 0 0 if (my($amount, $unit) = $string =~ /(\d+)\s([^\s]+)/mx)
740 0 0 unless $unit =~ /s\z/
762 0 1452 unless defined $args{'parsed'}{'ampm'}
764 0 1452 if $ENV{'DFF_DEBUG'}
769 707 745 if ($ampm =~ /a\.?m?\.?/mix) { }
745 0 elsif ($ampm =~ /p\.?m?\.?/mix) { }
771 0 707 if $ENV{'DFF_DEBUG'}
772 354 353 if ($args{'parsed'}{'hour'} == 12)
780 0 745 if $ENV{'DFF_DEBUG'}
782 351 394 if ($args{'parsed'}{'hour'} == 24)
795 0 807 unless exists $args{'parsed'}{'month'}
796 0 807 unless defined $args{'parsed'}{'month'}
798 13 794 if ($args{'parsed'}{'month'} == 0)
801 0 13 if $ENV{'DFF_DEBUG'}
825 0 18 $args{'args'} ? :
826 0 18 if defined $args{'parsed'}{'year'}
828 0 18 if ($constructor_args{'prefer_future'})
830 0 0 if ($args{'parsed'}{'month'} < 'DateTime::Format::Flexible'->base->month or $args{'parsed'}{'month'} eq 'DateTime::Format::Flexible'->base->month and $args{'parsed'}{'day'} < 'DateTime::Format::Flexible'->base->day)
845 2107 693 if length $args{'parsed'}{'year'} == 4
855 139 560 if ($year > 69) { }
857 1 138 if ($dt->strftime('%y') > 69) { }
869 1 559 if ($dt->strftime('%y') > 69) { }