]> Sergey Matveev's repositories - public-inbox.git/commitdiff
t/nntpd: reduce dependencies on internal API
authorEric Wong <e@yhbt.net>
Tue, 21 Apr 2020 03:22:51 +0000 (03:22 +0000)
committerEric Wong <e@yhbt.net>
Tue, 21 Apr 2020 20:13:52 +0000 (20:13 +0000)
Since the advent of run_script(), we can rely on it to simplify
our test code.  Changes like this will let us evolve the
internal API more easily while preserving stable CLI interfaces,
especially since we test the v2 path by default, now.

t/nntpd.t

index b2ef575d310866cd74f4fdd4c51d9621b4e3aa1c..2d7280a50d5e8a466c9a36649a916c8603aa293a 100644 (file)
--- a/t/nntpd.t
+++ b/t/nntpd.t
@@ -6,8 +6,6 @@ use Test::More;
 use PublicInbox::TestCommon;
 use PublicInbox::Spawn qw(which);
 require_mods(qw(DBD::SQLite));
-require PublicInbox::SearchIdx;
-require PublicInbox::Msgmap;
 require PublicInbox::InboxWritable;
 use Email::Simple;
 use IO::Socket;
@@ -79,8 +77,8 @@ EOF
                $im->add($mime);
                $im->done;
                if ($version == 1) {
-                       my $s = PublicInbox::SearchIdx->new($ibx, 1);
-                       $s->index_sync;
+                       ok(run_script(['-index', $ibx->{inboxdir}]),
+                               'indexed v1');
                }
        }
 
@@ -254,8 +252,8 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000
                $im->add($for_leafnode);
                $im->done;
                if ($version == 1) {
-                       my $s = PublicInbox::SearchIdx->new($ibx, 1);
-                       $s->index_sync;
+                       ok(run_script(['-index', $ibx->{inboxdir}]),
+                               'indexed v1');
                }
                my $hdr = $n->head("<$long_hdr>");
                my $expect = qr/\AMessage-ID: /i . qr/\Q<$long_hdr>\E/;