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   2594 use v5.26;
  5         17  
3 5     5   20 use strict;
  5         6  
  5         96  
4 5     5   15 use warnings;
  5         6  
  5         866  
5              
6 1     1 1 16 sub text { 'onhold' }
7 4     4 0 20 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 67 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 6 my $class = shift;
25 2 50 100     30 my $argvs = shift // return 0; return 0 unless $argvs->{'deliverystatus'};
  1         7  
26              
27 1 50       5 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         4 return 0
30             }
31              
32             1;
33             __END__