2 # Copyright (C) all contributors <meta@public-inbox.org>
3 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
5 use PublicInbox::TestCommon;
8 my @mods = qw(DBD::SQLite Xapian HTTP::Request::Common
9 Plack::Test URI::Escape Plack::Builder Plack::Test);
11 use_ok($_) for (qw(HTTP::Request::Common Plack::Test));
12 use_ok 'PublicInbox::WWW';
13 my $ibx = create_inbox 'v2', version => 2, sub {
15 $im->add(PublicInbox::Eml->new(<<'EOF')) or BAIL_OUT;
16 Message-Id: <200308111450.h7BEoOu20077@mail.osdl.org>
17 To: linux-kernel@vger.kernel.org
18 Subject: [OSDL] linux-2.6.0-test3 reaim results
20 Content-Type: multipart/mixed ;
21 boundary="==_Exmh_120757360"
22 Date: Mon, 11 Aug 2003 07:50:24 -0700
23 From: exmh user <x@example.com>
25 Freed^Wmultipart ain't what it used to be
30 my $www = PublicInbox::WWW->new(cfg_new($tmpdir, <<EOF));
31 [publicinbox "v2test"]
32 address = $ibx->{-primary_address}
33 inboxdir = $ibx->{inboxdir}
36 test_psgi(sub { $www->call(@_) }, sub {
38 for my $u ('/v2test/?q=%22ain\'t what it used to be%22&x=t',
39 '/v2test/new.atom', '/v2test/new.html') {
40 $res = $cb->(GET($u));
42 ok(index($raw, 'Freed^Wmultipart') >= 0, $u);
43 ok(index($raw, 'Warning: decoded text') >= 0, $u.' warns');