From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 7572C1FA04 for ; Tue, 21 Apr 2020 03:22:52 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/3] t/nntpd: reduce dependencies on internal API Date: Tue, 21 Apr 2020 03:22:51 +0000 Message-Id: <20200421032252.9151-3-e@yhbt.net> In-Reply-To: <20200421032252.9151-1-e@yhbt.net> References: <20200421032252.9151-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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 | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/t/nntpd.t b/t/nntpd.t index b2ef575d..2d7280a5 100644 --- 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/;