- $im->add($mime);
- $im->done;
- my $rev = $git->qx(qw(rev-list HEAD));
- like($rev, qr/\A[a-f0-9]{40}/, "good revision committed");
- @ls = $git->qx(qw(ls-tree -r --name-only HEAD));
- chomp @ls;
-}
-
-test_psgi($app, sub {
+ # multipart with two text bodies
+ $im->add(eml_load('t/plack-2-txt-bodies.eml')) or BAIL_OUT '->add';
+
+ # multipart with attached patch + filename
+ $im->add(eml_load('t/plack-attached-patch.eml')) or BAIL_OUT '->add';
+
+ $im->add(eml_load('t/data/attached-mbox-with-utf8.eml')) or xbail 'add';
+
+ # multipart collapsed to single quoted-printable text/plain
+ $im->add(eml_load('t/plack-qp.eml')) or BAIL_OUT '->add';
+ my $crlf = <<EOF;
+From: Me
+ <me\@example.com>
+To: $addr
+Message-Id: <crlf\@example.com>
+Subject: carriage
+ return
+ in
+ long
+ subject
+Date: Fri, 02 Oct 1993 00:00:00 +0000
+
+:(
+EOF
+ $crlf =~ s/\n/\r\n/sg;
+ $im->add(PublicInbox::Eml->new($crlf)) or BAIL_OUT '->add';
+
+ open my $fh, '>', "$ibx->{inboxdir}/description" or BAIL_OUT "open: $!";
+ print $fh "test for public-inbox\n" or BAIL_OUT;
+ close $fh or BAIL_OUT "close: $!";
+ open $fh, '>', "$ibx->{inboxdir}/pi_config";
+ print $fh <<EOF or BAIL_OUT;
+[publicinbox "test"]
+ inboxdir = $ibx->{inboxdir}
+ newsgroup = inbox.test
+ address = $addr
+ url = $pfx/
+EOF
+ close $fh or BAIL_OUT "close: $!";
+});
+
+my $env = { PI_CONFIG => "$ibx->{inboxdir}/pi_config", TMPDIR => $tmpdir };
+local @ENV{keys %$env} = values %$env;
+my $c1 = sub {