X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fv1-add-remove-add.t;h=736e414e354045b09bf97a5c1d106e6b052d4c9f;hb=b3f81ce0c71d5d4eca347f259b5ae69660a2cb13;hp=035fba5cdc17d64cbbb34337d6f751a052abdf02;hpb=d454d3467b99ad838c4f7fd143360a391b432b5b;p=public-inbox.git
diff --git a/t/v1-add-remove-add.t b/t/v1-add-remove-add.t
index 035fba5c..736e414e 100644
--- a/t/v1-add-remove-add.t
+++ b/t/v1-add-remove-add.t
@@ -1,19 +1,15 @@
-# Copyright (C) 2018-2019 all contributors
+# Copyright (C) 2018-2020 all contributors
# License: AGPL-3.0+
use strict;
use warnings;
use Test::More;
use PublicInbox::MIME;
use PublicInbox::Import;
-use File::Temp qw/tempdir/;
-
-foreach my $mod (qw(DBD::SQLite Search::Xapian)) {
- eval "require $mod";
- plan skip_all => "$mod missing for v1-add-remove-add.t" if $@;
-}
+use PublicInbox::TestCommon;
+require_mods(qw(DBD::SQLite Search::Xapian));
require PublicInbox::SearchIdx;
-my $inboxdir = tempdir('pi-add-remove-add-XXXXXX', TMPDIR => 1, CLEANUP => 1);
-is(system(qw(git init -q --bare), $inboxdir), 0);
+my ($inboxdir, $for_destroy) = tmpdir();
+is(system(qw(git init --bare -q), $inboxdir), 0);
my $ibx = {
inboxdir => $inboxdir,
name => 'test-add-remove-add',
@@ -32,7 +28,7 @@ my $mime = PublicInbox::MIME->create(
);
my $im = PublicInbox::Import->new($ibx->git, undef, undef, $ibx);
ok($im->add($mime), 'message added');
-ok($im->remove($mime), 'message added');
+ok($im->remove($mime), 'message removed');
ok($im->add($mime), 'message added again');
$im->done;
my $rw = PublicInbox::SearchIdx->new($ibx, 1);