File Coverage

lib/Sisimai/Reason/SyntaxError.pm
Criterion Covered Total %
statement 17 17 100.0
branch 3 4 75.0
condition 2 2 100.0
subroutine 7 7 100.0
pod 2 4 50.0
total 31 34 91.1


line stmt bran cond sub pod time code
1             package Sisimai::Reason::SyntaxError;
2 11     11   1736 use feature ':5.10';
  11         24  
  11         886  
3 11     11   66 use strict;
  11         26  
  11         223  
4 11     11   50 use warnings;
  11         21  
  11         2094  
5              
6 1     1 1 21 sub text { 'syntaxerror' }
7 4     4 0 15 sub description { 'Email rejected due to syntax error at sent commands in SMTP session' }
8 45     45 1 130 sub match { return undef }
9             sub true {
10             # Connection rejected due to syntax error or not
11             # @param [Sisimai::Data] argvs Object to be detected the reason
12             # @return [Integer] 1: Rejected due to syntax error
13             # 0: is not syntax error
14             # @since v4.1.25
15             # @see http://www.ietf.org/rfc/rfc2822.txt
16 57     57 0 119 my $class = shift;
17 57   100     268 my $argvs = shift // return undef;
18              
19 56 50       164 return 1 if $argvs->reason eq 'syntaxerror';
20 56 100       441 return 1 if $argvs->replycode =~ /\A[45]0[0-7]\z/;
21 51         453 return 0;
22             }
23              
24             1;
25             __END__