about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-07-01 06:11:13 +0000
committerEric Wong <e@80x24.org>2016-07-01 06:11:13 +0000
commitc056071159932b3b9c8454314887b6f45de2ae0f (patch)
tree94bfc8e945f84ca25fdef98c6c372f7dac0645de /t
parenta5719018b856d1763ca7faebfc0ffa82fb57320a (diff)
downloadpublic-inbox-c056071159932b3b9c8454314887b6f45de2ae0f.tar.gz
It seems common for address entries to end up as:
	"foo@example" <foo@example>

Avoid needlessly displaying the domain name in that case.
Diffstat (limited to 't')
-rw-r--r--t/address.t2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/address.t b/t/address.t
index c488a8ed..3191fed0 100644
--- a/t/address.t
+++ b/t/address.t
@@ -17,5 +17,7 @@ my @names = PublicInbox::Address::names(
 is_deeply(['User', 'e', 'John A. Doe', 'x'], \@names,
         'name extraction works as expected');
 
+@names = PublicInbox::Address::names('"user@example.com" <user@example.com>');
+is_deeply(['user'], \@names, 'address-as-name extraction works as expected');
 
 done_testing;