my $rw = PublicInbox::Search->new($git_dir, 1);
my $ro = PublicInbox::Search->new($git_dir);
+my $rw_commit = sub {
+ $rw = undef;
+ $rw = PublicInbox::Search->new($git_dir, 1);
+};
{
my $root = Email::MIME->create(
}
{
+ $rw_commit->();
$ro->reopen;
my $found = $ro->lookup_message('<root@s>');
ok($found, "message found");
# ghost vivication
{
- $rw->reopen;
+ $rw_commit->();
my $rmid = '<ghost-message@s>';
my $reply_to_ghost = Email::MIME->create(
header_str => [
# search thread on ghost
{
+ $rw_commit->();
$ro->reopen;
# Subject:
# long message-id
{
- $rw->reopen;
+ $rw_commit->();
$ro->reopen;
my $long_mid = 'last' . ('x' x 60). '@s';
my $long_midc = Digest::SHA::sha1_hex($long_mid);
my $long_id = $rw->add_message($long);
is($long_id, int($long_id), "long_id is an integer: $long_id");
+ $rw_commit->();
$ro->reopen;
my $res = $ro->query('references:root@s');
my @res = filter_mids($res);
body => "no References\n");
ok($rw->add_message($long_reply) > $long_id, "inserted long reply");
+ $rw_commit->();
$ro->reopen;
my $t = $ro->get_thread('root@s');
is($t->{count}, 4, "got all 4 mesages in thread");
# quote prioritization
{
- $rw->reopen;
+ $rw_commit->();
$rw->add_message(Email::MIME->create(
header_str => [
Date => 'Sat, 02 Oct 2010 00:00:01 +0000',