-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #522 from sisimai/increase-the-coverage-7e85
Increase the coverage 7e85
- Loading branch information
Showing
33 changed files
with
201 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -229,6 +229,10 @@ MAKETEST: { | |
NEW: { | ||
# ->new() | ||
$v = $p->new(shift @{ $p->find($e->{'v'}) }); | ||
is $v->new(''), undef; | ||
is $v->new([]), undef; | ||
is $v->new({'address' => ''}), undef; | ||
|
||
if( $e->{'a'} =~ /\A(.+)[@]([^@]+)\z/ ){ $a->[0] = $1; $a->[1] = $2; } | ||
if( $Package->is_mailerdaemon($e->{'v'}) ){ $a->[0] = $e->{'a'}; $a->[1] = ''; } | ||
|
||
|
@@ -289,14 +293,17 @@ MAKETEST: { | |
$a = '[email protected]'; | ||
$v = $p->new({ 'address' => $a }); | ||
is $p->expand_verp($a), '[email protected]', sprintf("%s->expand_verp(%s) = %s", $p, $a, $v); | ||
is $p->expand_verp(undef), undef; | ||
is $v->verp, $a, sprintf("%s->new(v)->verp = %s", $p, $a); | ||
|
||
} | ||
|
||
ALIAS: { | ||
$a = '[email protected]'; | ||
$v = $p->new({ 'address' => $a }); | ||
|
||
is $p->expand_alias($a), '[email protected]', sprintf("%s->expand_alias(%s) = %s", $p, $a, $v); | ||
is $p->expand_alias(undef), undef; | ||
is $v->alias, $a, sprintf("%s->new(v)->alias = %s", $p, $a); | ||
} | ||
|
||
|
@@ -310,21 +317,26 @@ MAKETEST: { | |
for my $e ( @$postmaster ) { | ||
ok $p->is_mailerdaemon($e), sprintf("%s->is_mailerdaemon = %s", $p, $e); | ||
} | ||
is $p->is_mailerdaemon(undef), 0; | ||
} | ||
|
||
for my $e ( @$isnotemail ) { | ||
$v = $p->s3s4($e); is $v, $e, sprintf("%s->s3s4(v) = %s", $p, $e); | ||
$v = $p->new({ 'address' => $e }); is $v, undef, sprintf("%s->new(v) = undef", $p); | ||
$v = $p->find($e); is $v, undef, sprintf("%s->find(v) = undef", $p); | ||
$v = $p->is_emailaddress($e); is $v, 0, sprintf("%s->is_emailaddress = 0", $p); | ||
IS_NOT_EMAIL: { | ||
for my $e ( @$isnotemail ) { | ||
$v = $p->s3s4($e); is $v, $e, sprintf("%s->s3s4(v) = %s", $p, $e); | ||
$v = $p->new({ 'address' => $e }); is $v, undef, sprintf("%s->new(v) = undef", $p); | ||
$v = $p->find($e); is $v, undef, sprintf("%s->find(v) = undef", $p); | ||
$v = $p->is_emailaddress($e); is $v, 0, sprintf("%s->is_emailaddress = 0", $p); | ||
} | ||
is $p->is_emailaddress(('neko-nyaan' x 25).'@example.jp'), 0; | ||
} | ||
|
||
UNDISCLOSED: { | ||
my $r = '[email protected]'; | ||
my $s = '[email protected]'; | ||
is $p->undisclosed(1), $r, sprintf("%s->undisclosed(r) = %s", $p, $r); | ||
is $p->undisclosed(0), $s, sprintf("%s->undisclosed(s) = %s", $p, $s); | ||
is $p->undisclosed(2), $r, sprintf("%s->undisclosed() = %s", $p, $r); | ||
is $p->undisclosed(1), $r, sprintf("%s->undisclosed(1) = %s", $p, $r); | ||
is $p->undisclosed(0), $s, sprintf("%s->undisclosed(0) = %s", $p, $s); | ||
is $p->undisclosed(2), $r, sprintf("%s->undisclosed(2) = %s", $p, $r); | ||
is $p->undisclosed(), $s, sprintf("%s->undisclosed( ) = %s", $p, $s); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,13 +26,15 @@ MAKETEST: { | |
is $Package->is_encoded(\$p2), 0, '->is_encoded = 0'; | ||
is $Package->is_encoded(\$b2), 1, '->is_encoded = 1'; | ||
is $Package->is_encoded(\$q3), 1, '->is_encoded = 1'; | ||
is $Package->is_encoded(''), undef; | ||
|
||
for my $e ( $p1, $p2 ) { | ||
$v0 = $Package->decodeH([$e]); | ||
$v0 = Encode::encode_utf8 $v0 if utf8::is_utf8 $v0; | ||
is $v0, $e, '->decodeH = '.$e; | ||
} | ||
|
||
is $Package->decodeH(''), ''; | ||
$v0 = $Package->decodeH([$b2]); | ||
$v0 = Encode::encode_utf8 $v0 if utf8::is_utf8 $v0; | ||
is $v0, $p2, '->decodeH = '.$p2; | ||
|
@@ -70,6 +72,9 @@ MAKETEST: { | |
# Base64, Quoted-Printable | ||
my $b6 = '44Gr44KD44O844KT'; | ||
my $p6 = 'にゃーん'; | ||
|
||
is $Package->decodeB(undef), undef; | ||
is $Package->decodeQ(undef), undef; | ||
is ${ $Package->decodeB(\$b6) }, $p6, '->decodeB = '.$p6; | ||
is ${ $Package->decodeQ(\'=4e=65=6b=6f') }, 'Neko', '->decodeQ = Neko'; | ||
} | ||
|
@@ -139,6 +144,8 @@ Reason: 550 [email protected]... No such user'; | |
is scalar @$v2, 2; | ||
is $v2->[0], 'text/plain; charset="utf-8"', '->haircut->[0] = text/plain; charset=utf-8'; | ||
is $v2->[1], 'quoted-printable', '->haircut->[1] = quoted-printable'; | ||
|
||
is $Package->haircut(undef), undef; | ||
} | ||
|
||
LEVELOUT: { | ||
|
@@ -184,6 +191,8 @@ Arrival-Date: Tue, 23 Dec 2014 20:39:34 +0000 | |
ok length $e->[0]; | ||
ok length $e->[2]; | ||
} | ||
isa_ok $Package->levelout('', 'neko'), 'ARRAY'; | ||
isa_ok $Package->levelout('neko', ''), 'ARRAY'; | ||
} | ||
|
||
MAKEFLAT: { | ||
|
@@ -246,7 +255,8 @@ Received: ... | |
unlike $v9, qr/4AAQSkZJRgABAQEBLAEsAAD/m, '->makeflat() does not contain base64'; | ||
like $v9, qr/kijitora[@]/m, '->makeflat() contains message/delivery-status part'; | ||
like $v9, qr/Received:/m, '->makeflat() contains message/rfc822 part'; | ||
is $Package->makeflat(), undef; | ||
is $Package->makeflat(undef, undef), undef; | ||
is $Package->makeflat('neko', undef), undef; | ||
} | ||
|
||
IRREGULAR_CASE: { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,8 @@ MAKETEST: { | |
$emindex++; | ||
} | ||
ok $emindex > 1; | ||
|
||
is $Package->new(undef), undef; | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,6 +25,10 @@ MAKETEST: { | |
]; | ||
my $temperrors = [ | ||
'smtp; 450 4.0.0 Temporary failure', | ||
'smtp; 554 4.4.7 Message expired: unable to deliver in 840 minutes.<421 4.4.2 Connection timed out>', | ||
'SMTP; 450 4.7.1 Access denied. IP name lookup failed [192.0.2.222]', | ||
'smtp; 451 4.7.650 The mail server [192.0.2.25] has been', | ||
'4.4.1 (Persistent transient failure - routing/network: no answer from host)', | ||
]; | ||
my $permerrors = [ | ||
'smtp;550 5.2.2 <[email protected]>... Mailbox Full', | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.