Branch Coverage

blib/lib/DateTimeX/ISO8601/Interval.pm
Criterion Covered Total %
branch 124 146 84.9


line true false branch
38 1 32 $duration && !$duration->clock_duration->is_zero ? :
14 33 $date =~ /T/ ? :
47 2 47 unless my $input = $interval
49 12 35 if ($interval =~ s[^R(\d*)/][])
50 6 6 $1 ne '' ? :
53 1 46 if ($interval =~ s[^$DURATION/][]) { }
15 31 elsif ($interval =~ s[/$DURATION$][]) { }
5 26 elsif ($interval =~ /^$DURATION$/) { }
25 1 elsif ($interval =~ m[^(.+?)(?:--|/)(.+?)$]) { }
70 1 5 unless ($args{'start'} or $args{'end'} or $args{'duration'})
73 10 36 if ($args{'time_zone'})
74 9 1 if ('DateTime::TimeZone'->is_valid_name($args{'time_zone'})) { }
92 42 105 if $$matches[$i]
118 0 120 unless ($args{'duration'} or $args{'start'} and $args{'end'})
122 9 133 if ($args{'time_zone'})
123 9 0 if (not ref $args{'time_zone'}) { }
0 0 elsif (not eval { do { $args{'time_zone'}->isa('DateTime::TimeZone') } }) { }
124 9 0 if ('DateTime::TimeZone'->is_valid_name($args{'time_zone'})) { }
142 3 129 if ($input and not ref $input)
145 0 3 unless $input = $parser->parse_datetime($input)
146 0 3 if ($$self{'time_zone'})
151 3 129 if ($input)
153 1 2 if $$self{'end'}
165 4 43 if ($input)
166 3 1 if (not ref $input) { }
169 0 3 unless $input = $parser->parse_datetime($input)
170 0 3 if ($$self{'time_zone'})
178 4 43 if ($input)
180 3 1 if $$self{'start'}
183 45 2 if (my $end = $$self{'end'}) { }
185 8 37 if ($$self{'precision'} eq 'date')
200 2 53 if ($duration)
201 1 1 if ($$self{'start'} and $$self{'end'}) { }
207 25 29 if $$self{'duration'}
209 5 24 if ($$self{'precision'} eq 'date')
221 1 14 if (defined $repeat)
233 0 12 if $counter < 0
235 0 12 unless my $start = $self->start || $args{'after'}
238 3 9 if (my $after = delete $args{'after'})
239 3 0 if $after->isa('DateTime')
0 3 unless eval { do { $after->is_finite if $after->isa('DateTime') } }
244 2 10 if ($until)
245 0 2 unless eval { do { $until->isa('DateTime') } }
246 0 2 if $until->is_infinite
256 16 95 if $repeat >= 0 and $counter >= $repeat
262 2 93 if ($until and $next_interval->contains($until))
274 1 1 unless $$self{'start'} or $$self{'end'}
276 2 37 unless (ref $date)
279 0 2 if (my $tz = $$self{'time_zone'})
283 0 39 unless eval { do { $date->isa('DateTime') } }
284 0 39 if ($$self{'time_zone'} and $date->time_zone->is_floating)
294 2 2 @_ ? :
314 2 61 if ($$self{'repeat'})
315 1 1 if ($$self{'repeat'} > 0) { }
322 19 44 $$self{'precision'} eq 'date' ? :
324 78 10 if $_
1 62 if ($$self{'precision'} ne 'date' and grep {$_->millisecond > 0 if $_;} $start, $end)
327 59 4 if (defined $start) { }
333 56 7 if (defined $end) { }
4 3 elsif (defined $start) { }
335 4 52 if ($start and $args{'abbreviate'})
339 8 12 if ($p =~ /^\D+$/) { }
8 4 elsif (index($interval[-1], "$same$p") == 0) { }
360 0 1 unless my $tz = shift()
361 1 0 if (not eval { do { $tz->isa('DateTime::TimeZone') } } and 'DateTime::TimeZone'->is_valid_name($tz))
364 0 1 unless (ref $tz)
370 2 0 if exists $$self{$_}
379 37 78 if $$self{'precision'} eq 'date'
380 4 74 if $date->time_zone->is_floating
381 14 60 if $date->time_zone->is_utc
391 9 23 unless my $number = $d->$f
397 14 10 unless my $number = $d->$f
399 5 5 unless $has_time++