From 61c44bbd8e57c719a1a4de75a1a11c412173e820 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 9 Jan 2024 12:49:13 +0000 Subject: address: avoid [ undef, undef ] address pairs For totally bogus things in address fields, we'll fall back to showing the original entry in the name column when using Email::Address::XS. The pure Perl version differs here, but we'll just let them be different when it comes to handling bogus data. --- t/address.t | 4 ++++ 1 file changed, 4 insertions(+) (limited to 't') diff --git a/t/address.t b/t/address.t index 16000d2d..86f47395 100644 --- a/t/address.t +++ b/t/address.t @@ -77,6 +77,10 @@ sub test_pkg { is_deeply([], \@emails , 'no address for local address'); @names = $emails->('Local User '); is_deeply([], \@names, 'no address, no name'); + + my $p = $pairs->('NAME, a@example, wtf@'); + is scalar(grep { defined($_->[0] // $_->[1]) } @$p), + scalar(@$p), 'something is always defined in bogus pairs'; } test_pkg('PublicInbox::Address'); -- cgit v1.2.3-24-ge0c7