diff options
author | Eric Wong <e@80x24.org> | 2016-07-06 00:36:59 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-07-06 07:12:45 +0000 |
commit | acac0cfb3afa26fd6556aa9f835869febcda97d8 (patch) | |
tree | b8b4df471634320c2a55e2536761e474a9a99b04 /t | |
parent | c952a7208d9941495a9efbe83d0e4af866f05a64 (diff) | |
download | public-inbox-acac0cfb3afa26fd6556aa9f835869febcda97d8.tar.gz |
They're uncommon, fortunately, but we make no attempt to handle nested comments (which would open us up to things like CVE-2015-7686) or use the comment in place of a missing name.
Diffstat (limited to 't')
-rw-r--r-- | t/address.t | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/t/address.t b/t/address.t index 3191fed0..287fcfa0 100644 --- a/t/address.t +++ b/t/address.t @@ -20,4 +20,13 @@ is_deeply(['User', 'e', 'John A. Doe', 'x'], \@names, @names = PublicInbox::Address::names('"user@example.com" <user@example.com>'); is_deeply(['user'], \@names, 'address-as-name extraction works as expected'); + +{ + my $backwards = 'u@example.com (John Q. Public)'; + @names = PublicInbox::Address::names($backwards); + is_deeply(\@names, ['u'], 'backwards name OK'); + my @emails = PublicInbox::Address::emails($backwards); + is_deeply(\@emails, ['u@example.com'], 'backwards emails OK'); +} + done_testing; |