about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2018-07-29 09:34:40 +0000
committerEric Wong <e@80x24.org>2018-07-29 09:43:05 +0000
commit31eda8c90633766692156c9c0af061dad6299c84 (patch)
treeb7f4bf75571c8cd202c6935c120637235ff058be
parent4edfee1a201259ce803d9153f38235f1c69bcd8f (diff)
downloadpublic-inbox-31eda8c90633766692156c9c0af061dad6299c84.tar.gz
It will help track down a bug which only seems to happen in v2 repos.
-rw-r--r--t/v2mda.t9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/v2mda.t b/t/v2mda.t
index f386289a..7df3a43a 100644
--- a/t/v2mda.t
+++ b/t/v2mda.t
@@ -8,6 +8,7 @@ use File::Temp qw/tempdir/;
 use Fcntl qw(SEEK_SET);
 use Cwd;
 
+my $V = 2;
 foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
         eval "require $mod";
         plan skip_all => "$mod missing for v2mda.t" if $@;
@@ -38,7 +39,8 @@ local $ENV{PI_DIR} = "$tmpdir/foo";
 local $ENV{PATH} = "$main_bin:blib/script:$ENV{PATH}";
 local $ENV{PI_EMERGENCY} = "$tmpdir/fail";
 ok(mkdir "$tmpdir/fail");
-my @cmd = (qw(public-inbox-init -V2), $ibx->{name},
+
+my @cmd = (qw(public-inbox-init), "-V$V", $ibx->{name},
                 $ibx->{mainrepo}, 'http://localhost/test',
                 $ibx->{address}->[0]);
 ok(PublicInbox::Import::run_die(\@cmd), 'initialized v2 inbox');
@@ -54,6 +56,11 @@ ok(PublicInbox::Import::run_die(['public-inbox-mda'], undef, $rdr),
         'mda delivered a message');
 
 $ibx = PublicInbox::Inbox->new($ibx);
+
+if ($V == 1) {
+        my $cmd = [ 'public-inbox-index', "$tmpdir/inbox" ];
+        ok(PublicInbox::Import::run_die($cmd, undef, $rdr), 'v1 indexed');
+}
 my $msgs = $ibx->search->query('');
 my $saved = $ibx->smsg_mime($msgs->[0]);
 is($saved->{mime}->as_string, $mime->as_string, 'injected message');