#!/usr/bin/perl use lib "lib", "t"; use MIME::Lite; use Test::More; use Utils; $MIME::Lite::VANILLA = 1; $MIME::Lite::PARANOID = 1; # Pairs: my @pairs = ( [' me@myhost.com ', 1, ''], [' mylogin ', 1, ''], [' "Me, Jr." < me@myhost.com > ', 1, ''], [' Me ', 1, ''], ['"Me, Jr." ', 1, ''], ['"Me@somewhere.com, Jr." ', 1, ''], ['me@myhost.com,you@yourhost.com', 2, ' '], ['"Me" , "You"', 2, ' '], ['"Me" , you@yourhost.com, "And also" ', 3, ' '], ['"Me" , mylogin ,yourlogin , She ', 4, ' '] ); plan tests => 2 * @pairs; # New: foreach my $pair (@pairs) { my ($to, $count, $result) = @$pair; my @addrs = MIME::Lite::extract_only_addrs($to); is(@addrs, $count, "as many addrs as expected"); is( join(' ', map {"<$_>"} @addrs), $result, "addrs stringify together as expected", ); }