File Coverage

lib/Sisimai/Reason/Vacation.pm
Criterion Covered Total %
statement 18 18 100.0
branch 1 2 50.0
condition 2 2 100.0
subroutine 7 7 100.0
pod 2 4 50.0
total 30 33 90.9


line stmt bran cond sub pod time code
1             package Sisimai::Reason::Vacation;
2 10     10   1657 use feature ':5.10';
  10         31  
  10         789  
3 10     10   55 use strict;
  10         18  
  10         231  
4 10     10   58 use warnings;
  10         19  
  10         2105  
5              
6 1     1 1 20 sub text { 'vacation' }
7 4     4 0 17 sub description { 'Email replied automatically due to a recipient is out of office' }
8             sub match {
9             # Try to match that the given text and regular expressions
10             # @param [String] argv1 String to be matched with regular expressions
11             # @return [Integer] 0: Did not match
12             # 1: Matched
13             # @since v4.22.3
14 32     32 1 335 my $class = shift;
15 32   100     110 my $argv1 = shift // return undef;
16              
17 31         53 state $index = [
18             'i am away on vacation',
19             'i am away until',
20             'i am out of the office',
21             'i will be traveling for work on',
22             ];
23 31 50       62 return 1 if grep { rindex($argv1, $_) > -1 } @$index;
  124         303  
24 31         150 return 0;
25             }
26 1     1 0 4 sub true { return undef }
27             1;
28              
29             __END__