]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/extsearch.t
extindex: implement --dedupe to fix old extindices
[public-inbox.git] / t / extsearch.t
index ae889ac67837969c214c98d8fdc5652460308f0f..5f0cd8662bfc0a102bbc32223e4c42a0fa199a30 100644 (file)
@@ -368,4 +368,15 @@ if ('remove v1test and test gc') {
        is(scalar(@it), 1, 'only one inbox left');
 }
 
+if ('dedupe + dry-run') {
+       my @cmd = ('-extindex', "$home/extindex");
+       my $opt = { 2 => \(my $err = '') };
+       ok(run_script([@cmd, '--dedupe'], undef, $opt), '--dedupe');
+       ok(run_script([@cmd, qw(--dedupe --dry-run)], undef, $opt),
+               '--dry-run --dedupe');
+       is $err, '', 'no errors';
+       ok(!run_script([@cmd, qw(--dry-run)], undef, $opt),
+               '--dry-run alone fails');
+}
+
 done_testing;