X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fmda.t;h=ec09cf69bb6a6e1a229b19aed2e15f3449d781d0;hb=0f6b0cac5bf10d036a84dbab732e8991edf56c34;hp=3bdccb4995e27394759eab1918d1a0c82c9d623f;hpb=95bdac7f09c69036efed537a4d03d5bdd2ae4eb6;p=public-inbox.git diff --git a/t/mda.t b/t/mda.t index 3bdccb49..ec09cf69 100644 --- a/t/mda.t +++ b/t/mda.t @@ -7,6 +7,7 @@ use Email::MIME; use Cwd qw(getcwd); use PublicInbox::MID qw(mid2path); use PublicInbox::Git; +use PublicInbox::InboxWritable; use PublicInbox::TestCommon; my ($tmpdir, $for_destroy) = tmpdir(); my $home = "$tmpdir/pi-home"; @@ -34,7 +35,7 @@ my $fail_bad_header = sub ($$$) { "no error on undeliverable ($msg)"); my $rev = $git->qx(qw(rev-list HEAD)); chomp $rev; - is($rev, $good_rev, "bad revision not commited ($msg)"); + is($rev, $good_rev, "bad revision not committed ($msg)"); @f = glob("$faildir/*/*"); is(scalar @f, 1, "faildir written to"); [ $in, $out, $err ]; @@ -62,12 +63,9 @@ local $ENV{GIT_COMMITTER_NAME} = eval { use PublicInbox::MDA; use PublicInbox::Address; use Encode qw/encode/; - my $mbox = 't/utf8.mbox'; - open(my $fh, '<', $mbox) or die "failed to open mbox: $mbox\n"; - my $str = eval { local $/; <$fh> }; - close $fh; - my $msg = Email::MIME->new($str); - + my $eml = 't/utf8.eml'; + my $msg = PublicInbox::InboxWritable::mime_from_path($eml) or + die "failed to open $eml: $!"; my $from = $msg->header('From'); my ($author) = PublicInbox::Address::names($from); my ($email) = PublicInbox::Address::emails($from);