X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fnntpd.t;h=4993b29fe3f55c38e7f1591d81c942f9ffa68568;hb=5d8dbb4aca5afcc6b98a4d951f03003fb7eaf356;hp=b2ef575d310866cd74f4fdd4c51d9621b4e3aa1c;hpb=f1e0136491b6cb1ab7ca432eb051a880d788f5ad;p=public-inbox.git diff --git a/t/nntpd.t b/t/nntpd.t index b2ef575d..4993b29f 100644 --- a/t/nntpd.t +++ b/t/nntpd.t @@ -6,10 +6,8 @@ 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 PublicInbox::MIME; use IO::Socket; use Socket qw(IPPROTO_TCP TCP_NODELAY); use Net::NNTP; @@ -59,7 +57,7 @@ $ibx = PublicInbox::Inbox->new($ibx); # ensure successful message delivery { - my $mime = Email::MIME->new(<new(< From: =?utf-8?Q?El=C3=A9anor?= Cc: $addr @@ -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/; @@ -331,12 +329,12 @@ Date: Fri, 02 Oct 1993 00:00:00 +0000 $n = $s = undef; $td->join; - my $eout = eval { - local $/; + is($?, 0, 'no error in exited process'); + my $eout = do { open my $fh, '<', $err or die "open $err failed: $!"; + local $/; <$fh>; }; - is($?, 0, 'no error in exited process'); unlike($eout, qr/wide/i, 'no Wide character warnings'); }