Branch Coverage

blib/lib/Date/HolidayParser.pm
Criterion Covered Total %
branch 111 180 61.6


line true false branch
63 0 56 if (not defined $Year) { }
0 56 elsif ($Year =~ /\D/) { }
0 56 elsif ($Year < 1971 or $Year > 2037) { }
78 5 51 unless ($self->_cache->{$Year})
120 15 0 if ($number > 31) { }
138 6 0 if (defined $file)
149 0 6 if (not $self->file) { }
0 6 elsif (not -e $self->file) { }
178 15 35 if (defined $ADD_DAYS)
182 5 45 if (defined $SUBTRACT_DAYS)
201 0 95 unless defined $PosixTime
221 0 35 if $Unix_Time =~ /\D/
247 0 0 if ($BeSilent and not $self->silent) { }
0 0 elsif (not $self->silent) { }
288 15 35 if (defined $$CreativeParser{'AddEaster'})
292 10 40 if (defined $$CreativeParser{'MonthDay'})
302 0 50 unless (defined $$CreativeParser{'IsMonth'} or defined $NumericYDay)
308 20 30 if (defined $$CreativeParser{'MustBeDay'}) { }
5 25 elsif (defined $$CreativeParser{'IsMonth'}) { }
25 0 elsif (defined $NumericYDay) { }
313 15 5 if (defined $$CreativeParser{'IsMonth'} and defined $$CreativeParser{'Number'}) { }
5 0 elsif (defined $$CreativeParser{'IsMonth'} and defined $$CreativeParser{'DateNumeric'}) { }
0 0 elsif (defined $$CreativeParser{'IsMonth'}) { }
317 0 15 unless (defined $$CreativeParser{'Number'})
322 5 10 if ($$CreativeParser{'Number'} eq 'last') { }
327 5 10 if (_Holiday_DayName($proper_yday, $Year) eq $$CreativeParser{'MustBeDay'})
338 25 0 if (_Holiday_DayName($proper_yday, $Year) eq $$CreativeParser{'MustBeDay'})
346 5 20 unless ($detect_mon eq $MonthMapping{$$CreativeParser{'IsMonth'}})
359 5 5 if ($$CreativeParser{'Number'} eq 'first') { }
5 0 elsif ($$CreativeParser{'Number'} eq 'second') { }
0 0 elsif ($$CreativeParser{'Number'} eq 'third') { }
0 0 elsif ($$CreativeParser{'Number'} eq 'fourth') { }
380 0 0 unless $$CreativeParser{'Number'} eq 'null'
396 20 0 if (defined $NumericYDay) { }
400 0 20 unless (defined $$CreativeParser{'BeforeOrAfter'})
405 10 10 if ($$CreativeParser{'BeforeOrAfter'} eq 'before') { }
10 0 elsif ($$CreativeParser{'BeforeOrAfter'} eq 'after') { }
411 10 5 if (_Holiday_DayName($FinalYDay, $Year) eq $$CreativeParser{'MustBeDay'})
424 10 30 if (_Holiday_DayName($FinalYDay, $Year) eq $$CreativeParser{'MustBeDay'})
446 0 5 unless (defined $$CreativeParser{'DateNumeric'})
459 0 25 if (defined $$CreativeParser{'MustBeDay'})
468 0 50 if (defined $$CreativeParser{'Every'} and not defined $$CreativeParser{'Number'})
472 0 50 if (defined $$CreativeParser{'Every'} and defined $$CreativeParser{'Length'})
477 50 0 if (defined $FinalYDay and $FinalYDay =~ /^\d+$/) { }
0 0 elsif (defined $FinalYDay) { }
481 55 0 if (defined $FinalYDay)
487 5 50 if (defined $$CreativeParser{'Every'} and defined $$CreativeParser{'Number'}) { }
0 50 elsif (defined $$CreativeParser{'Length'} and $$CreativeParser{'Length'} > 0) { }
490 0 5 if ($$CreativeParser{'Number'} ne 'second') { }
502 0 0 unless $$CreativeParser{'Length'}--
530 0 6 unless -e $File
531 0 6 unless -r $File
533 0 6 unless open my $HolidayFile, '<', $File
538 72 60 if $Line =~ /^\s*[:;#]/
539 0 60 if $Line =~ /^\s*$/
552 42 18 if ($Line =~ /^\s*\"/) { }
562 18 42 if ($LineMode eq 'PreDec')
570 0 18 if (not length $PreDec) { }
577 18 0 if ($PreDec =~ /^(weekend|red)$/) { }
0 0 elsif ($PreDec =~ /^(black|small|blue|green|cyan|magenta|yellow)$/) { }
605 0 60 if ($HolidayName =~ /^\"*$/)
611 6 54 if ($Line =~ /^\s*(weekend|red|black|small|blue|green|cyan|magenta|yellow)/)
618 6 0 if ($HolidayDec =~ /^(weekend|red)$/) { }
0 0 elsif ($HolidayDec =~ /^(black|small|blue|green|cyan|magenta|yellow)$/) { }
625 0 0 unless (defined $HolidayType and $HolidayType eq 'red')
636 0 60 if (not $Line =~ /^\s*on/) { }
654 54 258 if /^\s*$/
655 18 240 if (/^(last|first|second|third|fourth)$/) { }
24 216 elsif (/^(monday|tuesday|wednesday|thursday|friday|saturday|sunday)$/) { }
12 204 elsif (m[^\d+[/\.]\d+\.?$]) { }
30 174 elsif (/^(january|february|march|april|may|june|july|august|september|october|november|december)$/) { }
12 162 elsif (/^plus$/) { }
6 156 elsif (/^minus$/) { }
0 156 elsif (/^length$/) { }
18 138 elsif (/^easter$/) { }
0 138 elsif (/^weekend$/) { }
30 108 elsif (/^\d+$/) { }
6 102 elsif (/^(before|after)$/) { }
6 96 elsif (/^every$/) { }
96 0 elsif (/^(in|on|days|day)$/) { }
671 6 6 if (/^\d+\.\d+$/) { }
6 0 elsif (m[^\d+/\d+$]) { }
710 0 30 if $_ > 365
712 12 18 unless (defined $CreativeParser{'NextIs'} and $CreativeParser{'NextIs'})
719 12 6 if ($CreativeParser{'NextIs'} eq 'add') { }
6 0 elsif ($CreativeParser{'NextIs'} eq 'sub') { }
0 0 elsif ($CreativeParser{'NextIs'} eq 'length') { }
721 0 12 if (defined $CreativeParser{'AddDays'}) { }
733 0 6 if (defined $CreativeParser{'SubtDays'}) { }
745 0 0 if (defined $CreativeParser{'Length'}) { }