File Coverage

lib/Sisimai/Reason/OnHold.pm
Criterion Covered Total %
statement 17 17 100.0
branch 3 6 50.0
condition 3 4 75.0
subroutine 7 7 100.0
pod 2 4 50.0
total 32 38 84.2


line stmt bran cond sub pod time code
1             package Sisimai::Reason::OnHold;
2 5     5   3222 use v5.26;
  5         19  
3 5     5   22 use strict;
  5         19  
  5         139  
4 5     5   21 use warnings;
  5         9  
  5         1081  
5              
6 1     1 1 21 sub text { 'onhold' }
7 4     4 0 16 sub description { 'Sisimai could not decided the reason due to there is no (or less) detailed information for judging the reason' }
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.0.0
14 44     44 1 112 return 0;
15             }
16              
17             sub true {
18             # On hold, Could not decide the bounce reason...
19             # @param [Sisimai::Fact] argvs Object to be detected the reason
20             # @return [Integer] 1: Status code is "onhold"
21             # 0: is not "onhold"
22             # @since v4.1.28
23             # @see http://www.ietf.org/rfc/rfc2822.txt
24 2     2 0 4 my $class = shift;
25 2 50 100     7 my $argvs = shift // return 0; return 0 unless $argvs->{'deliverystatus'};
  1         6  
26              
27 1 50       2 return 1 if $argvs->{'reason'} eq 'onhold';
28 1 50 50     10 return 1 if (Sisimai::SMTP::Status->name($argvs->{'deliverystatus'}) || '') eq 'onhold';
29 1         2 return 0
30             }
31              
32             1;
33             __END__