1 # Copyright (C) 2014-2015 all contributors <meta@public-inbox.org>
2 # License: AGPLv3 or later (https://www.gnu.org/licenses/agpl-3.0.txt)
9 use PublicInbox::Import;
10 use PublicInbox::Inbox;
11 use File::Temp qw/tempdir/;
12 my $tmpdir = tempdir('pi-http-XXXXXX', TMPDIR => 1, CLEANUP => 1);
13 my $git_dir = "$tmpdir/gittest";
14 my $ibx = PublicInbox::Inbox->new({
15 address => 'test@example',
16 -primary_address => 'test@example',
19 url => 'http://example.com/test',
22 my $im = PublicInbox::Import->new($git, 'tester', 'test@example');
26 is(0, system(qw(git init -q --bare), $git_dir), "git init");
29 foreach my $i (1..6) {
30 # my $pid = open(my $pipe, "|-");
31 # defined $pid or die "fork/pipe failed: $!\n";
33 # exec("ssoma-mda", $git_dir);
35 my $mid = "<$i\@example.com>";
36 my $mid_line = "Message-ID: $mid";
38 $mid_line .= "In-Reply-To: $prev";
41 my $mime = Email::MIME->new(<<EOF);
42 From: ME <me\@example.com>
43 To: U <u\@example.com>
46 Date: Thu, 01 Jan 1970 00:00:00 +0000
48 > This is a long multi line quote so it should not be allowed to
49 > show up in its entirty in the Atom feed. drop me
53 > inline me here, short quote
57 like($im->add($mime), qr/\A:\d+\z/, 'inserted message');
65 my $cb = PublicInbox::Feed::generate_html_index({
69 require 't/common.perl';
70 like(stream_to_string($cb), qr/html/, "feed is valid HTML :)");