X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fconvert-compact.t;h=fc46083b74f02e9ef733458ccd3234fd47008d3e;hb=eea47b676127bcdba34fe0c1269b7324dd58d479;hp=c6da64eaa69daf0ab0bf9f3b1c1ce654c2b06ea4;hpb=3c313f9034aac96182e2efdc2f92c40803626f32;p=public-inbox.git diff --git a/t/convert-compact.t b/t/convert-compact.t index c6da64ea..fc46083b 100644 --- a/t/convert-compact.t +++ b/t/convert-compact.t @@ -7,11 +7,7 @@ use PublicInbox::MIME; use PublicInbox::Spawn qw(which); use PublicInbox::TestCommon; require_git(2.6); -my @mods = qw(DBD::SQLite Search::Xapian); -foreach my $mod (@mods) { - eval "require $mod"; - plan skip_all => "$mod missing for convert-compact.t" if $@; -} +require_mods(qw(DBD::SQLite Search::Xapian)); which('xapian-compact') or plan skip_all => 'xapian-compact missing for '.__FILE__; @@ -73,6 +69,13 @@ is(scalar(@xdir), 1, 'got one xapian directory after compact'); is(((stat($xdir[0]))[2]) & 07777, 0755, 'sharedRepository respected on v1 compact'); +my $hwm = do { + my $mm = $ibx->mm; + $ibx->cleanup; + $mm->num_highwater; +}; +ok(defined($hwm) && $hwm > 0, "highwater mark set #$hwm"); + $cmd = [ '-convert', $ibx->{inboxdir}, "$tmpdir/v2" ]; ok(run_script($cmd, undef, $rdr), 'convert works'); @xdir = glob("$tmpdir/v2/xap*/*"); @@ -87,6 +90,7 @@ my $env = { NPROC => 2 }; ok(run_script($cmd, $env, $rdr), 'v2 compact works'); $ibx->{inboxdir} = "$tmpdir/v2"; $ibx->{version} = 2; +is($ibx->mm->num_highwater, $hwm, 'highwater mark unchanged in v2 inbox'); @xdir = glob("$tmpdir/v2/xap*/*"); foreach (@xdir) {