X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fpsgi_multipart_not.t;h=5f4c06b76569b22323d7b143a8e27f4268a13c73;hb=8ffed15abbec68463ff3f3105d6651c8a4b5d813;hp=e36820f4a3a39ebf93a9b6b348ff342f8af78d79;hpb=0283273a14e1871955f6a9132f4f3f7884ec8a3f;p=public-inbox.git
diff --git a/t/psgi_multipart_not.t b/t/psgi_multipart_not.t
index e36820f4..5f4c06b7 100644
--- a/t/psgi_multipart_not.t
+++ b/t/psgi_multipart_not.t
@@ -1,28 +1,20 @@
-# Copyright (C) 2018-2020 all contributors
+#!perl -w
+# Copyright (C) 2018-2021 all contributors
# License: AGPL-3.0+
use strict;
-use warnings;
-use Test::More;
+use v5.10.1;
+use PublicInbox::TestCommon;
use PublicInbox::Eml;
use PublicInbox::Config;
-use PublicInbox::TestCommon;
+require_git 2.6;
my @mods = qw(DBD::SQLite Search::Xapian HTTP::Request::Common
Plack::Test URI::Escape Plack::Builder Plack::Test);
require_mods(@mods);
use_ok($_) for (qw(HTTP::Request::Common Plack::Test));
use_ok 'PublicInbox::WWW';
-use_ok 'PublicInbox::V2Writable';
-my ($repo, $for_destroy) = tmpdir();
-my $ibx = PublicInbox::Inbox->new({
- inboxdir => $repo,
- name => 'multipart-not',
- version => 2,
- -primary_address => 'test@example.com',
-});
-my $im = PublicInbox::V2Writable->new($ibx, 1);
-$im->{parallel} = 0;
-
-my $mime = PublicInbox::Eml->new(<<'EOF');
+my $ibx = create_inbox 'v2', version => 2, sub {
+ my ($im) = @_;
+ $im->add(PublicInbox::Eml->new(<<'EOF')) or BAIL_OUT;
Message-Id: <200308111450.h7BEoOu20077@mail.osdl.org>
To: linux-kernel@vger.kernel.org
Subject: [OSDL] linux-2.6.0-test3 reaim results
@@ -35,17 +27,13 @@ From: exmh user
Freed^Wmultipart ain't what it used to be
EOF
-ok($im->add($mime), 'added broken multipart message');
-$im->done;
-
+};
my $cfgpfx = "publicinbox.v2test";
my $cfg = <{-primary_address}
-$cfgpfx.inboxdir=$repo
+$cfgpfx.inboxdir=$ibx->{inboxdir}
EOF
-my $config = PublicInbox::Config->new(\$cfg);
-my $www = PublicInbox::WWW->new($config);
-
+my $www = PublicInbox::WWW->new(PublicInbox::Config->new(\$cfg));
my ($res, $raw);
test_psgi(sub { $www->call(@_) }, sub {
my ($cb) = @_;
@@ -57,6 +45,4 @@ test_psgi(sub { $www->call(@_) }, sub {
ok(index($raw, 'Warning: decoded text') >= 0, $u.' warns');
}
});
-
-done_testing();
-1;
+done_testing;