X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fv2-add-remove-add.t;h=cfdc8cf1ddbfc980fc0d3ebb8318c09281c9d33d;hb=0283273a14e1871955f6a9132f4f3f7884ec8a3f;hp=c427de6e1b938ef9db73eb5a6f6551565afbd985;hpb=95bdac7f09c69036efed537a4d03d5bdd2ae4eb6;p=public-inbox.git diff --git a/t/v2-add-remove-add.t b/t/v2-add-remove-add.t index c427de6e..cfdc8cf1 100644 --- a/t/v2-add-remove-add.t +++ b/t/v2-add-remove-add.t @@ -3,7 +3,7 @@ use strict; use warnings; use Test::More; -use PublicInbox::MIME; +use PublicInbox::Eml; use PublicInbox::TestCommon; require_git(2.6); require_mods(qw(DBD::SQLite Search::Xapian)); @@ -16,20 +16,19 @@ my $ibx = { -primary_address => 'test@example.com', }; $ibx = PublicInbox::Inbox->new($ibx); -my $mime = PublicInbox::MIME->create( - header => [ - From => 'a@example.com', - To => 'test@example.com', - Subject => 'this is a subject', - Date => 'Fri, 02 Oct 1993 00:00:00 +0000', - 'Message-ID' => '', - ], - body => "hello world\n", -); +my $mime = PublicInbox::Eml->new(<<'EOF'); +From: a@example.com +To: test@example.com +Subject: this is a subject +Date: Fri, 02 Oct 1993 00:00:00 +0000 +Message-ID: + +hello world +EOF my $im = PublicInbox::V2Writable->new($ibx, 1); $im->{parallel} = 0; ok($im->add($mime), 'message added'); -ok($im->remove($mime), 'message added'); +ok($im->remove($mime), 'message removed'); ok($im->add($mime), 'message added again'); $im->done; my $msgs = $ibx->recent({limit => 1000});