Branch Coverage

lib/Badger/Timestamp.pm
Criterion Covered Total %
branch 59 68 86.7


line true false branch
92 6 42 if (@_ > 1)
112 6 20 @_ ? :
130 5 66 if (@_ > 1) { }
28 38 elsif (@_ == 1 and defined $_[0]) { }
137 0 28 ref $_[0] eq 'HASH' ? :
144 66 5 if ($time = $config->{'time'}) { }
145 45 21 if (&numlike($time)) { }
3 18 elsif (&is_object(scalar(ref $class || $class), $time)) { }
185 0 21 unless defined $self->{'timestamp'}
189 1 20 unless @$self{@YMDHMS} = map({0 + ($_ || 0);} $self->{'timestamp'} =~ /$STAMP_REGEX/o)
196 576 0 defined $_ ? :
233 2 23 if (@_ == 1) { }
236 0 2 ref $_[0] eq 'HASH' ? :
249 2 17 if (scalar keys %$args == 1 and defined $args->{'month'} || defined $args->{'months'} || defined $args->{'year'} || defined $args->{'years'})
260 131 19 unless defined $args->{$element}
266 31 119 if defined $args->{$element}
284 3 22 if ($self->{'second'} > 59)
288 4 21 if ($self->{'minute'} > 59)
292 2 23 if ($self->{'hour'} > 23)
300 0 1 unless ($self->{'month'} > 0)
322 0 2 if ($fix_month) { }
327 0 2 if ($self->{'month'} == 12) { }
347 0 2 if &numlike($duration)
359 2 0 if ($duration =~ /^ ( -? (?: \d+ | \d*\.\d+ ) ) \s* ([smhdMy]?) /x) { }
381 5 30 if $self->{'etime'} and @_ == 1 and &numlike($_[0])
386 45 7 @_ && &is_object(scalar(ref $self || $self), $_[0]) ? :
389 21 199 if ($self->{$item} < $comp->{$item}) { }
20 179 elsif ($self->{$item} > $comp->{$item}) { }
427 23 19 if ($month == 4 or $month == 6 or $month == 9 or $month == 11) { }
2 17 elsif ($month == 2) { }
431 1 1 $self->leap_year(@_) ? :
441 6 4 if ($year % 4) { }
1 3 elsif ($year % 400 == 0) { }
1 2 elsif ($year % 100 == 0) { }