use Test::More qw[no_plan]; # $Id: tests.t,v 1.1 2004/05/27 03:11:42 cwest Exp $ use strict; use_ok 'Email::Address'; my @list = ( [ '', [] ], [ '"\'\'\'advocacy@perl.org \' \' \'" ', [ [ '"\'\'\'advocacy@perl.org \' \' \'"', 'advocacy@perl.org', undef ] ] ], [ '"\'\'advocacy@perl.org \' \'" ', [ [ '"\'\'advocacy@perl.org \' \'"', 'advocacy@perl.org', undef ] ] ], [ '"\'. Jerry a\'" ', [ [ '"\'. Jerry a\'"', 'JerryPanshen@aol.com', undef ] ] ], [ '"\'Adam Turoff\'" , advocacy@perl.org', [ [ '"\'Adam Turoff\'"', 'adam.turoff@isinet.com', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"\'Andy Lester\'" , "\'Gabor Szabo\'" , advocacy@perl.org', [ [ '"\'Andy Lester\'"', 'andy@petdance.com', undef ], [ '"\'Gabor Szabo\'"', 'gabor@tracert.com', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"\'Ask Bjoern Hansen\'" , ', [ [ '"\'Ask Bjoern Hansen\'"', 'ask@perl.org', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"\'Chris Nandor\'" , "\'David E. Wheeler\'" ', [ [ '"\'Chris Nandor\'"', 'pudge@pobox.com', undef ], [ '"\'David E. Wheeler\'"', 'David@wheeler.net', undef ] ] ], [ '"\'Chris Nandor\'" , "\'Elaine -HFB- Ashton\'" ', [ [ '"\'Chris Nandor\'"', 'pudge@pobox.com', undef ], [ '"\'Elaine -HFB- Ashton\'"', 'elaine@chaos.wustl.edu', undef ] ] ], [ '"\'Chris Nandor\'" , "\'Jon Orwant\'" , , , ', [ [ '"\'Chris Nandor\'"', 'pudge@pobox.com', undef ], [ '"\'Jon Orwant\'"', 'orwant@media.mit.edu', undef ], [ undef, 'chip@valinux.com', undef ], [ undef, 'tidbit@sri.net', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"\'Chris Nandor\'" , , ', [ [ '"\'Chris Nandor\'"', 'pudge@pobox.com', undef ], [ undef, 'advocacy@perl.org', undef ], [ undef, 'perl5-porters@perl.org', undef ] ] ], [ '"\'Chris Nandor\'" , advocacy@perl.org', [ [ '"\'Chris Nandor\'"', 'pudge@pobox.com', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"\'Chris Nandor\'" , advocacy@perl.org, perl5-porters@perl.org', [ [ '"\'Chris Nandor\'"', 'pudge@pobox.com', undef ], [ undef, 'advocacy@perl.org', undef ], [ undef, 'perl5-porters@perl.org', undef ] ] ], [ '"\'David H. Adler \'" , "\'advocacy@perl.org \'" ', [ [ '"\'David H. Adler \'"', 'dha@panix.com', undef ], [ '"\'advocacy@perl.org \'"', 'advocacy@perl.org', undef ] ] ], [ '"\'Doucette, Bob\'" , \'Rich Bowen\' ', [ [ '"\'Doucette, Bob\'"', 'BDoucette@tesent.com', undef ], [ '\'Rich Bowen\'', 'rbowen@rcbowen.com', undef ] ] ], [ '"\'Elaine -HFB- Ashton \'" , "Turoff, Adam" ', [ [ '"\'Elaine -HFB- Ashton \'"', 'elaine@chaos.wustl.edu', undef ], [ '"Turoff, Adam"', 'adam.turoff@isinet.com', undef ] ] ], [ '"\'Elaine -HFB- Ashton\'" ', [ [ '"\'Elaine -HFB- Ashton\'"', 'elaine@chaos.wustl.edu', undef ] ] ], [ '"\'Elaine -HFB- Ashton\'" , "\'Larry Wall\'" ', [ [ '"\'Elaine -HFB- Ashton\'"', 'elaine@chaos.wustl.edu', undef ], [ '"\'Larry Wall\'"', 'larry@wall.org', undef ] ] ], [ '"\'Elaine -HFB- Ashton\'" , "\'Larry Wall\'" , "\'Jon Orwant\'" , , , ', [ [ '"\'Elaine -HFB- Ashton\'"', 'elaine@chaos.wustl.edu', undef ], [ '"\'Larry Wall\'"', 'larry@wall.org', undef ], [ '"\'Jon Orwant\'"', 'orwant@media.mit.edu', undef ], [ undef, 'chip@valinux.com', undef ], [ undef, 'tidbit@sri.net', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"\'Elaine -HFB- Ashton\'" , "\'Larry Wall\'" , "\'Jon Orwant\'" , , , ', [ [ '"\'Elaine -HFB- Ashton\'"', 'elaine@chaos.wustl.edu', undef ], [ '"\'Larry Wall\'"', 'larry@wall.org', undef ], [ '"\'Jon Orwant\'"', 'orwant@media.mit.edu', undef ], [ undef, 'chip@valinux.com', undef ], [ undef, 'tidbit@sri.net', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"\'Elaine -HFB- Ashton\'" , ', [ [ '"\'Elaine -HFB- Ashton\'"', 'elaine@chaos.wustl.edu', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"\'John Porter\'" , "\'advocacy@perl.org\'" ', [ [ '"\'John Porter\'"', 'jdporter@min.net', undef ], [ '"\'advocacy@perl.org\'"', 'advocacy@perl.org', undef ] ] ], [ '"\'Larry Wall\'" , "\'Jon Orwant\'" , , , ', [ [ '"\'Larry Wall\'"', 'larry@wall.org', undef ], [ '"\'Jon Orwant\'"', 'orwant@media.mit.edu', undef ], [ undef, 'chip@valinux.com', undef ], [ undef, 'tidbit@sri.net', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"\'Madeline Schnapp \'" , "\'advocacy@perl.org \'" ', [ [ '"\'Madeline Schnapp \'"', 'madeline@oreilly.com', undef ], [ '"\'advocacy@perl.org \'"', 'advocacy@perl.org', undef ] ] ], [ '"\'Mark Mielke\'" ', [ [ '"\'Mark Mielke\'"', 'markm@nortelnetworks.com', undef ] ] ], [ '"\'Pamela Carter\'" , ', [ [ '"\'Pamela Carter\'"', 'pcarter150@comcast.net', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"\'Shlomi Fish\'" ', [ [ '"\'Shlomi Fish\'"', 'shlomif@vipe.technion.ac.il', undef ] ] ], [ '"\'Steve Lane\'" , "\'Chris Nandor\'" , advocacy@perl.org, perl5-porters@perl.org', [ [ '"\'Steve Lane\'"', 'sml@zfx.com', undef ], [ '"\'Chris Nandor\'"', 'pudge@pobox.com', undef ], [ undef, 'advocacy@perl.org', undef ], [ undef, 'perl5-porters@perl.org', undef ] ] ], [ '"\'Tom Christiansen\'" , Horsley Tom , "\'Steve Lane\'" , advocacy@perl.org, perl5-porters@perl.org', [ [ '"\'Tom Christiansen\'"', 'tchrist@chthon.perl.com', undef ], [ 'Horsley Tom', 'Tom.Horsley@ccur.com', undef ], [ '"\'Steve Lane\'"', 'sml@zfx.com', undef ], [ undef, 'advocacy@perl.org', undef ], [ undef, 'perl5-porters@perl.org', undef ] ] ], [ '"\'abigail@foad.org\'" , "Michael R. Wolf"', [ [ '"\'abigail@foad.org\'"', 'abigail@foad.org', undef ], [ '"Michael R. Wolf"', 'MichaelRunningWolf@att.net', undef ] ] ], [ '"\'abigail@foad.org\'" , Michael G Schwern ', [ [ '"\'abigail@foad.org\'"', 'abigail@foad.org', undef ], [ 'Michael G Schwern', 'schwern@pobox.com', undef ] ] ], [ '"\'abigail@foad.org\'" , Michael G Schwern , Nicholas Clark , Piers Cawley , advocacy@perl.org', [ [ '"\'abigail@foad.org\'"', 'abigail@foad.org', undef ], [ 'Michael G Schwern', 'schwern@pobox.com', undef ], [ 'Nicholas Clark', 'nick@ccl4.org', undef ], [ 'Piers Cawley', 'pdcawley@bofh.org.uk', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"\'advocacy@perl.org \'" ', [ [ '"\'advocacy@perl.org \'"', 'advocacy@perl.org', undef ] ] ], [ '"\'advocacy@perl.org \'" , "Turoff, Adam" ', [ [ '"\'advocacy@perl.org \'"', 'advocacy@perl.org', undef ], [ '"Turoff, Adam"', 'adam.turoff@isinet.com', undef ] ] ], [ '"\'advocacy@perl.org\'" ', [ [ '"\'advocacy@perl.org\'"', 'advocacy@perl.org', undef ] ] ], [ '"\'bwarnock@capita.com\'" , advocacy@perl.org', [ [ '"\'bwarnock@capita.com\'"', 'bwarnock@capita.com', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"\'duff@pobox.com\'" ', [ [ '"\'duff@pobox.com\'"', 'duff@pobox.com', undef ] ] ], [ '"\'london-list@happyfunball.pm.org\'" ', [ [ '"\'london-list@happyfunball.pm.org\'"', 'london-list@happyfunball.pm.org', undef ] ] ], [ '"\'perl-hackers@stlouis.pm.org\'" ', [ [ '"\'perl-hackers@stlouis.pm.org\'"', 'perl-hackers@stlouis.pm.org', undef ] ] ], [ '"\'perl-hackers@stlouis.pm.org\'" , advocacy@perl.org, marsneedswomen@happyfunball.pm.org', [ [ '"\'perl-hackers@stlouis.pm.org\'"', 'perl-hackers@stlouis.pm.org', undef ], [ undef, 'advocacy@perl.org', undef ], [ undef, 'marsneedswomen@happyfunball.pm.org', undef ] ] ], [ '"" ', [ [ 'advocacy', 'advocacy@perl.org', undef ] ] ], [ '"Adam Turoff" , "Elaine -HFB- Ashton" ', [ [ '"Adam Turoff"', 'adam.turoff@isinet.com', undef ], [ '"Elaine -HFB- Ashton"', 'elaine@chaos.wustl.edu', undef ] ] ], [ '"Adam Turoff" , "Elaine -HFB- Ashton" , "Brent Michalski" , "Madeline Schnapp" , , ', [ [ '"Adam Turoff"', 'adam.turoff@isinet.com', undef ], [ '"Elaine -HFB- Ashton"', 'elaine@chaos.wustl.edu', undef ], [ '"Brent Michalski"', 'brent@perlguy.net', undef ], [ '"Madeline Schnapp"', 'madeline@oreilly.com', undef ], [ undef, 'advocacy@perl.org', undef ], [ undef, 'betsy@oreilly.com', undef ] ] ], [ '"Adam Turoff" , "Paul Prescod" ', [ [ '"Adam Turoff"', 'adam.turoff@isinet.com', undef ], [ '"Paul Prescod"', 'paul@prescod.net', undef ] ] ], [ '"Alan Olsen" , "Rich Bowen" ', [ [ '"Alan Olsen"', 'alan@clueserver.org', undef ], [ '"Rich Bowen"', 'rbowen@rcbowen.com', undef ] ] ], [ '"Andreas J. Koenig" ', [ [ '"Andreas J. Koenig"', 'andreas.koenig@anima.de', undef ] ] ], [ '"Andreas J. Koenig" , advocacy@perl.org', [ [ '"Andreas J. Koenig"', 'andreas.koenig@anima.de', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"Andreas J. Koenig" , advocacy@perl.org, regn@ActiveState.com', [ [ '"Andreas J. Koenig"', 'andreas.koenig@anima.de', undef ], [ undef, 'advocacy@perl.org', undef ], [ undef, 'regn@ActiveState.com', undef ] ] ], [ '"Andy Wardley" ', [ [ '"Andy Wardley"', 'abw@cre.canon.co.uk', undef ] ] ], [ '"Bas A. Schulte" ', [ [ '"Bas A. Schulte"', 'bschulte@zeelandnet.nl', undef ] ] ], [ '"Bas A.Schulte" ', [ [ '"Bas A.Schulte"', 'bschulte@zeelandnet.nl', undef ] ] ], [ '"Betsy Waliszewski" , "perl-advocacy" ', [ [ '"Betsy Waliszewski"', 'betsy@oreilly.com', undef ], [ '"perl-advocacy"', 'advocacy@perl.org', undef ] ] ], [ '"Bradley M. Kuhn" ', [ [ '"Bradley M. Kuhn"', 'bkuhn@ebb.org', undef ] ] ], [ '"Brammer, Phil" ', [ [ '"Brammer, Phil"', 'PBRA01@CONAGRAFROZEN.COM', undef ] ] ], [ '"Brent Michalski" , "Madeline Schnapp" , , ', [ [ '"Brent Michalski"', 'brent@perlguy.net', undef ], [ '"Madeline Schnapp"', 'madeline@oreilly.com', undef ], [ undef, 'advocacy@perl.org', undef ], [ undef, 'betsy@oreilly.com', undef ] ] ], [ '"Brian Wilson" ', [ [ '"Brian Wilson"', 'bwilson@songline.com', undef ] ] ], [ '"Calvin Lee" , ', [ [ '"Calvin Lee"', 'bodyshock911@hotmail.com', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"Calvin Lee" , advocacy@perl.org', [ [ '"Calvin Lee"', 'bodyshock911@hotmail.com', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"Chip Salzenberg" ', [ [ '"Chip Salzenberg"', 'chip@valinux.com', undef ] ] ], [ '"Chip Salzenberg" , "Elaine -HFB- Ashton" ', [ [ '"Chip Salzenberg"', 'chip@valinux.com', undef ], [ '"Elaine -HFB- Ashton"', 'elaine@chaos.wustl.edu', undef ] ] ], [ '"Chris Devers" , "Uri Guttman" ', [ [ '"Chris Devers"', 'cdevers@boston.com', undef ], [ '"Uri Guttman"', 'uri@stemsystems.com', undef ] ] ], [ '"Chris Nandor" ', [ [ '"Chris Nandor"', 'pudge@pobox.com', undef ] ] ], [ '"Chris Nandor" , "Nathan Torkington" , "Peter Scott" ', [ [ '"Chris Nandor"', 'pudge@pobox.com', undef ], [ '"Nathan Torkington"', 'gnat@frii.com', undef ], [ '"Peter Scott"', 'Peter@PSDT.com', undef ] ] ], [ '"Chris Nandor" , "Nathan Torkington" , , "Peter Scott" ', [ [ '"Chris Nandor"', 'pudge@pobox.com', undef ], [ '"Nathan Torkington"', 'gnat@frii.com', undef ], [ undef, 'advocacy@perl.org', undef ], [ '"Peter Scott"', 'Peter@PSDT.com', undef ] ] ], [ '"Clinton A. Pierce" ', [ [ '"Clinton A. Pierce"', 'clintp@geeksalad.org', undef ] ] ], [ '"Clinton A. Pierce" , madeline@oreilly.com, pudge@pobox.com, advocacy@perl.org', [ [ '"Clinton A. Pierce"', 'clintp@geeksalad.org', undef ], [ undef, 'madeline@oreilly.com', undef ], [ undef, 'pudge@pobox.com', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"Curtis Poe" , ', [ [ '"Curtis Poe"', 'cp@onsitetech.com', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"Curtis Poe" , advocacy@perl.org', [ [ '"Curtis Poe"', 'cp@onsitetech.com', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"Dave Cross" ', [ [ '"Dave Cross"', 'dave@dave.org.uk', undef ] ] ], [ '"David E. Wheeler" ', [ [ '"David E. Wheeler"', 'David@Wheeler.net', undef ] ] ], [ '"David E. Wheeler" , "\'Larry Wall\'" , "\'Jon Orwant\'" , chip@valinux.com, tidbit@sri.net, advocacy@perl.org', [ [ '"David E. Wheeler"', 'David@Wheeler.net', undef ], [ '"\'Larry Wall\'"', 'larry@wall.org', undef ], [ '"\'Jon Orwant\'"', 'orwant@media.mit.edu', undef ], [ undef, 'chip@valinux.com', undef ], [ undef, 'tidbit@sri.net', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"David E. Wheeler" , \'Elaine -HFB- Ashton\' , \'Larry Wall\' , \'Jon Orwant\' , tidbit@sri.net, advocacy@perl.org', [ [ '"David E. Wheeler"', 'David@Wheeler.net', undef ], [ '\'Elaine -HFB- Ashton\'', 'elaine@chaos.wustl.edu', undef ], [ '\'Larry Wall\'', 'larry@wall.org', undef ], [ '\'Jon Orwant\'', 'orwant@media.mit.edu', undef ], [ undef, 'tidbit@sri.net', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"David Grove" ', [ [ '"David Grove"', 'pete@petes-place.com', undef ] ] ], [ '"David Grove" , ', [ [ '"David Grove"', 'pete@petes-place.com', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"David H. Adler" ', [ [ '"David H. Adler"', 'dha@panix.com', undef ] ] ], [ '"David H. Adler" , , ', [ [ '"David H. Adler"', 'dha@panix.com', undef ], [ undef, 'advocacy@perl.org', undef ], [ undef, 'simon@brecon.co.uk', undef ] ] ], [ '"David H. Adler" , advocacy@perl.org', [ [ '"David H. Adler"', 'dha@panix.com', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"David H. Adler" , advocacy@perl.org, perl5-porters@perl.org', [ [ '"David H. Adler"', 'dha@panix.com', undef ], [ undef, 'advocacy@perl.org', undef ], [ undef, 'perl5-porters@perl.org', undef ] ] ], [ '"David H. Adler" ,advocacy@perl.org', [ [ '"David H. Adler"', 'dha@panix.com', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"Edwards, Darryl" ', [ [ '"Edwards, Darryl"', 'Darryl.Edwards@adc.com', undef ] ] ], [ '"Elaine -HFB- Ashton" ', [ [ '"Elaine -HFB- Ashton"', 'elaine@chaos.wustl.edu', undef ] ] ], [ '"Elaine -HFB- Ashton" , "Brent Michalski" ', [ [ '"Elaine -HFB- Ashton"', 'elaine@chaos.wustl.edu', undef ], [ '"Brent Michalski"', 'brent@perlguy.net', undef ] ] ], [ '"Elaine -HFB- Ashton" , "Frank Schmuck, CFO" ', [ [ '"Elaine -HFB- Ashton"', 'elaine@chaos.wustl.edu', undef ], [ '"Frank Schmuck, CFO"', 'fschmuck@lcch.org', undef ] ] ], [ '"Elaine -HFB- Ashton" , "Peter Scott" ', [ [ '"Elaine -HFB- Ashton"', 'elaine@chaos.wustl.edu', undef ], [ '"Peter Scott"', 'Peter@PSDT.com', undef ] ] ], [ '"Elaine -HFB- Ashton" , "Tom Christiansen" , , "David H. Adler" , ', [ [ '"Elaine -HFB- Ashton"', 'elaine@chaos.wustl.edu', undef ], [ '"Tom Christiansen"', 'tchrist@chthon.perl.com', undef ], [ undef, 'Ben_Tilly@trepp.com', undef ], [ '"David H. Adler"', 'dha@panix.com', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"Elaine -HFB- Ashton" , "brian d foy" , ', [ [ '"Elaine -HFB- Ashton"', 'elaine@chaos.wustl.edu', undef ], [ '"brian d foy"', 'tidbit@sri.net', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"Elaine -HFB- Ashton" , ', [ [ '"Elaine -HFB- Ashton"', 'elaine@chaos.wustl.edu', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"Frank Schmuck, CFO" ', [ [ '"Frank Schmuck, CFO"', 'fschmuck@lcch.org', undef ] ] ], [ '"Frank Schmuck, CFO" , "\'abigail@foad.org\'" , Michael G Schwern , Nicholas Clark , advocacy@perl.org', [ [ '"Frank Schmuck, CFO"', 'fschmuck@lcch.org', undef ], [ '"\'abigail@foad.org\'"', 'abigail@foad.org', undef ], [ 'Michael G Schwern', 'schwern@pobox.com', undef ], [ 'Nicholas Clark', 'nick@ccl4.org', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"G. Wade Johnson" ', [ [ '"G. Wade Johnson"', 'gwadej@anomaly.org', undef ] ] ], [ '"Gabor Szabo" ', [ [ '"Gabor Szabo"', 'gabor@tracert.com', undef ] ] ], [ '"Greg Norris (humble visionary genius)" , ', [ [ '"Greg Norris"', 'nextrightmove@yahoo.com', '(humble visionary genius)' ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"Greg Norris \\(humble visionary genius\\)" ', [ [ '"Greg Norris \\(humble visionary genius\\)"', 'nextrightmove@yahoo.com', undef ] ] ], [ '"Greg Norris humble visionary genius\\"" ', [ [ '"Greg Norris humble visionary genius\\""', 'nextrightmove@yahoo.com', undef ] ] ], [ '"Helton, Brandon" , perl6-language@perl.org, advocacy@perl.org', [ [ '"Helton, Brandon"', 'bhelton@harris.com', undef ], [ undef, 'perl6-language@perl.org', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"Jan Dubois" ', [ [ '"Jan Dubois"', 'jand@ActiveState.com', undef ] ] ], [ '"Jason W. May" ', [ [ '"Jason W. May"', 'jasonmay@pacbell.net', undef ] ] ], [ '"Jason W. May" ', [ [ '"Jason W. May"', 'jmay@pobox.com', undef ] ] ], [ '"Jason W. May" , ', [ [ '"Jason W. May"', 'jmay@pobox.com', undef ], [ undef, 'advocacy@perl.org', undef ] ] ], [ '"Jason W. May" , advocacy@perl.org', [ [ '"Jason W. May"', 'jmay@pobox.com', undef ], [ undef, 'advocacy@perl.org', undef ] ] ] ); for (@list) { s/-- ATAT --/@/g; my @addrs = Email::Address->parse($_->[0]); my @tests = map Email::Address->new(@{$_}), @{$_->[1]}; foreach (@addrs) { isa_ok $_, 'Email::Address'; my $test = shift @tests; is $_->format, $test->format, $test->format; is "$_", $test->format, "$_"; is $_->name, $test->name, $test->name; } }