| 1 |
#!/usr/bin/perl |
| 2 |
use strict; |
| 3 |
use warnings; |
| 4 |
|
| 5 |
use MIME::Lite; |
| 6 |
use Test::More; |
| 7 |
|
| 8 |
# Make a tester... here are 3 different alternatives: |
| 9 |
$MIME::Lite::VANILLA = 1; |
| 10 |
$MIME::Lite::PARANOID = 1; |
| 11 |
|
| 12 |
my $msg; |
| 13 |
|
| 14 |
$msg = MIME::Lite->new(From=>"me", To=>"you", Data=>"original text"); |
| 15 |
$msg->attach(Data => "attachment 1"); |
| 16 |
$msg->attach(Data => "attachment 2"); |
| 17 |
my $part = $msg->attach(Data => "attachment 3"); |
| 18 |
$part->attach(Data => "attachment 4"); |
| 19 |
$part->attach(Data => "attachment 5"); |
| 20 |
|
| 21 |
is($msg->parts, 4, "->parts count is correct"); |
| 22 |
|
| 23 |
is($msg->parts_DFS, 7, "->parts_DFS count is correct"); |
| 24 |
|
| 25 |
done_testing; |