| 1 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 2 | 1 | ▶ | use warnings FATAL => 'all'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 3 | |||||||||||||
| 4 | package HTML::Tested::Test::DateTime; | ||||||||||||
| 5 | 1 | ▶ | use DateTime::Duration; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | ▶ | use DateTime; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 1 | ▶ | use Data::Dumper; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | 1 | ▶ | use POSIX (); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 9 | |||||||||||||
| 10 | 0 | ▶ | sub now { | ||||||||||
|
Subroutine
now: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 11 | 0 | my $class = shift; | |||||||||||
| 12 | 0 | my $res = DateTime->now; | |||||||||||
| 13 | 0 | $res->set_time_zone(POSIX::strftime('%z', localtime)); | |||||||||||
| 14 | 0 | ▶ | my $self = bless { _dt => $res, _interval => (shift || 1) }, $class; | ||||||||||
|
Condition0%0/2
shift() || 1
MC/DC0%0/1
shift() || 1
shift()
Truth table0%0/2
A
A= shift()
| |||||||||||||
| 15 | 0 | return $self; | |||||||||||
| 16 | } | ||||||||||||
| 17 | |||||||||||||
| 18 | 0 | ▶ | sub strftime { | ||||||||||
|
Subroutine
strftime: not called CC=2 SCAR=17.9
Pod
undocumented
| |||||||||||||
| 19 | 0 | my $self = shift; | |||||||||||
| 20 | 0 | my @res; | |||||||||||
| 21 | 0 | ▶ | for (my $i = 0; $i < $self->{_interval}; $i++) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 22 | 0 | my $d = $self->{_dt} + DateTime::Duration->new(seconds => $i); | |||||||||||
| 23 | 0 | push @res, $d->strftime(@_); | |||||||||||
| 24 | } | ||||||||||||
| 25 | 0 | return Dumper(\@res); | |||||||||||
| 26 | } | ||||||||||||
| 27 | |||||||||||||
| 28 | 0 | ▶ | sub clone { return shift(); } | ||||||||||
|
Subroutine
clone: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 29 | 0 | ▶ | sub set_locale { | ||||||||||
|
Subroutine
set_locale: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||||
| 30 | 0 | my $self = shift; | |||||||||||
| 31 | 0 | $self->{_dt}->set_locale(@_); | |||||||||||
| 32 | 0 | return $self; | |||||||||||
| 33 | } | ||||||||||||
| 34 | |||||||||||||
| 35 | 1 | 1; | |||||||||||