Branch Coverage

blib/lib/PDL/DateTime.pm
Criterion Covered Total %
branch 146 284 51.4


line true false branch
37 102 1551 ref $class ? :
45 1 9 if ref $data eq 'PDL::DateTime'
49 1 8 if (ref $data eq 'ARRAY') { }
8 0 elsif (ref $data eq 'PDL') { }
53 8 0 if ($data->type == longlong()) { }
0 0 elsif ($data->type == double()) { }
70 0 0 if (&looks_like_number($data)) { }
0 0 elsif ($data) { }
98 1 2 if ref $ep eq 'ARRAY'
107 1 2 if ref $rd eq 'ARRAY'
117 1 2 if ref $sd eq 'ARRAY'
127 1 2 if ref $jd eq 'ARRAY'
143 0 3 unless defined $y and defined $m and defined $d
145 1 2 if ref $y eq 'ARRAY'
146 1 2 if ref $d eq 'ARRAY'
147 1 2 if ref $m eq 'ARRAY'
148 1 2 if ref $H eq 'ARRAY'
149 1 2 if ref $M eq 'ARRAY'
150 1 2 if ref $S eq 'ARRAY'
151 1 2 if ref $U eq 'ARRAY'
154 2 1 if defined $H
155 2 1 if defined $M
156 2 1 if defined $S
158 2 1 if defined $U
173 0 44 unless defined $count and defined $unit
174 5 39 unless defined $step
176 0 44 $start eq 'now' ? :
178 5 39 if ($unit eq 'year')
184 0 44 if ($unit eq 'quarter')
190 12 32 if ($unit eq 'month') { }
27 5 elsif (my $inc = $INC_SECONDS{$unit}) { }
304 16 32 if ($self->is_inplace) { }
308 3 13 if ($unit eq 'month') { }
0 13 elsif ($unit eq 'quarter') { }
4 9 elsif ($unit eq 'year') { }
1 8 elsif ($unit eq 'millisecond') { }
1 7 elsif ($unit eq 'microsecond') { }
7 0 elsif (my $inc = $INC_SECONDS{$unit}) { }
334 6 26 if ($unit eq 'month') { }
0 26 elsif ($unit eq 'quarter') { }
8 18 elsif ($unit eq 'year') { }
2 16 elsif ($unit eq 'millisecond') { }
2 14 elsif ($unit eq 'microsecond') { }
14 0 elsif (my $inc = $INC_SECONDS{$unit}) { }
359 8 16 if ($self->is_inplace) { }
361 0 8 unless defined $unit
362 1 7 if ($unit eq 'year') { }
0 7 elsif ($unit eq 'quarter') { }
1 6 elsif ($unit eq 'month') { }
1 5 elsif ($unit eq 'millisecond') { }
5 0 elsif (my $inc = $INC_SECONDS{$unit}) { }
376 1 4 $unit eq 'week' ? :
377 0 5 if $up and $unit eq 'week'
383 0 16 unless defined $unit
384 3 13 if ($unit eq 'year') { }
0 13 elsif ($unit eq 'quarter') { }
2 11 elsif ($unit eq 'month') { }
1 10 elsif ($unit eq 'millisecond') { }
10 0 elsif (my $inc = $INC_SECONDS{$unit}) { }
397 2 8 $unit eq 'week' ? :
398 0 10 if $up and $unit eq 'week'
406 5 0 &looks_like_number($_[-1]) ? :
408 5 0 if not $fmt or $fmt eq 'auto'
420 70 43 if not $fmt or $fmt eq 'auto'
421 1 112 if ($fmt eq 'epoch') { }
1 111 elsif ($fmt eq 'epoch_int') { }
436 0 0 if $self->nelem == 1
438 0 0 unless $unit
439 0 0 if $unit eq 'week'
440 0 0 if $unit eq 'day'
441 0 0 if $unit eq 'hour'
442 0 0 if $unit eq 'minute'
443 0 0 if $unit eq 'second'
444 0 0 if $unit eq 'millisecond'
451 0 0 if $freq eq 'BAD'
452 0 0 if ($freq < 1000) { }
0 0 elsif ($freq < 1000000) { }
0 0 elsif ($freq < 60000000) { }
0 0 elsif ($freq < 3600000000) { }
0 0 elsif ($freq < 86400000000) { }
0 0 elsif ($freq == 86400000000) { }
0 0 elsif ($freq == 604800000000) { }
0 0 elsif ($freq >= 2419200000000 and $freq <= 2678400000000) { }
0 0 elsif ($freq >= 7776000000000 and $freq <= 7948800000000) { }
0 0 elsif ($freq >= 31536000000000 and $freq <= 31622400000000) { }
497 0 0 unless $unit
498 0 0 unless $self->ndims == 1
499 0 0 unless $self->is_increasing
505 0 0 unless $unit
506 0 0 unless $self->ndims == 1
507 0 0 unless $self->is_increasing
510 0 0 if ($end->nelem == 0) { }
514 0 0 unless $end->at($end->nelem - 1) == $end->nelem - 1
521 0 0 unless $unit
522 0 0 unless $self->ndims == 1
523 0 0 unless $self->is_increasing
526 0 0 if $end->nelem > 1
532 0 0 unless $unit
538 0 0 if $strictly
544 0 0 if $strictly
567 1 0 $self->ndims > 0 ? :
575 0 0 unless ref $other or &looks_like_number($other)
581 0 0 unless ref $other or &looks_like_number($other)
587 0 0 unless ref $other or &looks_like_number($other)
593 0 0 unless ref $other or &looks_like_number($other)
599 0 0 unless ref $other or &looks_like_number($other)
605 0 266 unless ref $other or &looks_like_number($other)
611 8 67 if (which($self % 86400000000 != 0)->nelem == 0) { }
4 63 elsif (which($self % 60000000 != 0)->nelem == 0) { }
2 61 elsif (which($self % 1000000 != 0)->nelem == 0) { }
2 59 elsif (which($self % 1000 != 0)->nelem == 0) { }
642 0 4 $up ? :
4 3 if $yflag
643 0 0 $up ? :
0 7 if $qflag
644 0 7 $up ? :
662 0 0 unless my $rv = eval { do { 'Time::Moment'->from_epoch($ts, $us * 1000)->to_string('reduced', 1) } }
683 1 0 if (ref $val eq 'ARRAY' and not ref $val->[0]) { }
0 0 elsif (ref $val eq 'ARRAY') { }
699 1 647 if $v =~ /^\d\d\d\d-\d\d-\d\d$/
701 0 647 if $v =~ /^\d\d\d\d-\d\d-\d\d[ T]\d\d:\d\d$/
703 589 58 if $v =~ /^\d\d\d\d-\d\d-\d\d[ T]\d\d:\d\d:\d\d(\.\d+)?$/
710 32 604 if (ref $dt eq 'ARRAY') { }
714 0 600 if ($inplace) { }
715 0 0 ref $_ ? :
0 0 if ref $_ ne 'ARRAY'
721 32 0 if not $inplace
724 0 604 if (&looks_like_number($dt)) { }
604 0 elsif (not ref $dt) { }
0 0 elsif (ref $dt eq 'DateTime' or ref $dt eq 'Time::Piece') { }
0 0 elsif (ref $dt eq 'Time::Moment') { }
728 0 604 $dt eq 'now' ? :
736 0 604 unless $tm
743 0 879 unless defined $v
744 111 768 if (ref $v eq 'ARRAY') { }
768 0 elsif (not ref $v) { }
748 763 0 if ($inplace) { }
749 763 0 if ref $_ ne 'ARRAY'
755 0 111 if not $inplace
759 0 768 unless defined $tm
760 0 768 if ($fmt eq 'Time::Moment') { }
784 21 10 if (defined $delta_m)