-# Copyright (C) 2019-2020 all contributors <meta@public-inbox.org>
+# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
use strict;
use warnings;
for my $R (qw(2 4 1 3 3)) {
delete $ibx->{search}; # release old handles
my $cmd = [@xcpdb, "-R$R", $ibx->{inboxdir}];
- push @$cmd, '--compact' if $R == 1;
+ push @$cmd, '--compact' if $R == 1 && have_xapian_compact;
ok(run_script($cmd), "xcpdb -R$R");
my @new_shards = grep(m!/\d+\z!, glob("$ibx->{inboxdir}/xap*/*"));
is(scalar(@new_shards), $R, 'resharded to two shards');