| 1 | package Cron::Toolkit::Pattern::LastW; | ||||||||||||||||||||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 4 | 2 | ▶ | use parent 'Cron::Toolkit::Pattern'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | |||||||||||||||||||||||||||||
| 6 | 41 | ▶ | sub type { | ||||||||||||||||||||||||||
|
Subroutine
type: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 7 | 41 | return 'lastW'; | |||||||||||||||||||||||||||
| 8 | } | ||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||
| 10 | 32 | ▶ | sub match { | ||||||||||||||||||||||||||
|
Subroutine
match: called CC=5 SCAR=17.4
Pod
undocumented
| |||||||||||||||||||||||||||||
| 11 | 32 | my ($self, $value, $tm) = @_; | |||||||||||||||||||||||||||
| 12 | 32 | my $dom = $tm->day_of_month; | |||||||||||||||||||||||||||
| 13 | 32 | my $days_in_month = $tm->length_of_month; | |||||||||||||||||||||||||||
| 14 | 32 | my $candidate = $days_in_month; | |||||||||||||||||||||||||||
| 15 | 32 | ▶ | while ( $candidate >= 1 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 16 | 32 | my $test_tm = $tm->with_day_of_month($candidate); | |||||||||||||||||||||||||||
| 17 | 32 | my $test_dow = $test_tm->day_of_week; | |||||||||||||||||||||||||||
| 18 | 32 | ▶ | if ( $test_dow >= 1 && $test_dow <= 5 ) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
$test_dow >= 1 and $test_dow <= 5
MC/DC0%0/2
$test_dow >= 1 and $test_dow <= 5
$test_dow >= 1
$test_dow <= 5
Truth table33%1/3
A and B
A= $test_dow >= 1B= $test_dow <= 5
| |||||||||||||||||||||||||||||
| 19 | 32 | ▶ | return $dom == $candidate ? 1 : 0; | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||
| 21 | 0 | $candidate--; | |||||||||||||||||||||||||||
| 22 | } | ||||||||||||||||||||||||||||
| 23 | 0 | return 0; | |||||||||||||||||||||||||||
| 24 | } | ||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 1 | ▶ | sub to_english { | ||||||||||||||||||||||||||
|
Subroutine
to_english: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 27 | 1 | return 'on the last weekday'; | |||||||||||||||||||||||||||
| 28 | } | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 2 | 1; | |||||||||||||||||||||||||||