When input string passed to parse method contains trailing garbage, mark the last parsed object as invalid
Pali
1 year, 8 months ago
18 | 18 |
$Carp::Internal{'Test::Builder'} = 1;
|
19 | 19 |
$Carp::Internal{'Test::More'} = 1;
|
20 | 20 |
|
21 | |
use Test::More tests => 511;
|
|
21 |
use Test::More tests => 516;
|
22 | 22 |
use Test::Builder;
|
23 | 23 |
|
24 | 24 |
local $SIG{__WARN__} = sub {
|
|
695 | 695 |
is($address->user(), 'winston.smith.', $subtest);
|
696 | 696 |
is($address->host(), 'recdep.minitrue', $subtest);
|
697 | 697 |
is($address->address(), '"winston.smith."@recdep.minitrue', $subtest);
|
|
698 |
}
|
|
699 |
|
|
700 |
{
|
|
701 |
my $subtest = 'test method parse() in scalar context with valid address followed by garbage';
|
|
702 |
my $address = Email::Address::XS->parse('winston.smith@recdep.minitrue garbage');
|
|
703 |
ok(!$address->is_valid(), $subtest);
|
|
704 |
is($address->original(), 'winston.smith@recdep.minitrue ', $subtest);
|
|
705 |
is($address->user(), 'winston.smith', $subtest);
|
|
706 |
is($address->host(), 'recdep.minitrue', $subtest);
|
|
707 |
is($address->address(), 'winston.smith@recdep.minitrue', $subtest);
|
698 | 708 |
}
|
699 | 709 |
|
700 | 710 |
}
|