X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=t%2Fsearch-thr-index.t;h=62745dbce1d5122db18164999addb4902e43812e;hp=1bea59fd87ae35c4988f4444fe1ff19cbaff3857;hb=4eee5af6011cc8cdefb66c9729952c7eff5c0b0b;hpb=e6b7a7f5f70fb89a54ff158bc6c8b564149947e5 diff --git a/t/search-thr-index.t b/t/search-thr-index.t index 1bea59fd..62745dbc 100644 --- a/t/search-thr-index.t +++ b/t/search-thr-index.t @@ -1,12 +1,12 @@ -# Copyright (C) 2017-2020 all contributors +#!perl -w +# Copyright (C) 2017-2021 all contributors # License: AGPL-3.0+ use strict; -use warnings; -use bytes (); # only for bytes::length +use v5.10.1; use Test::More; use PublicInbox::TestCommon; use PublicInbox::MID qw(mids); -use PublicInbox::MIME; +use PublicInbox::Eml; require_mods(qw(DBD::SQLite Search::Xapian)); require PublicInbox::SearchIdx; require PublicInbox::Smsg; @@ -42,10 +42,10 @@ my @mids; foreach (reverse split(/\n\n/, $data)) { $_ .= "\n"; - my $mime = PublicInbox::MIME->new(\$_); + my $mime = PublicInbox::Eml->new(\$_); $mime->header_set('From' => 'bw@g'); $mime->header_set('To' => 'git@vger.kernel.org'); - my $bytes = bytes::length($mime->as_string); + my $bytes = length($mime->as_string); my $mid = mids($mime->header_obj)->[0]; my $smsg = bless { bytes => $bytes, @@ -60,9 +60,9 @@ foreach (reverse split(/\n\n/, $data)) { my $prev; my %tids; -my $dbh = $rw->{over}->connect; +my $dbh = $rw->{oidx}->dbh; foreach my $mid (@mids) { - my $msgs = $rw->{over}->get_thread($mid); + my $msgs = $rw->{oidx}->get_thread($mid); is(3, scalar(@$msgs), "got all messages from $mid"); foreach my $m (@$msgs) { my $tid = $dbh->selectrow_array(<<'', undef, $m->{num}); @@ -78,21 +78,21 @@ $rw->commit_txn_lazy; $xdb = $rw->begin_txn_lazy; { - my $mime = PublicInbox::MIME->new(<<''); + my $mime = PublicInbox::Eml->new(<<''); Subject: [RFC 00/14] Message-Id: <1-bw@g> From: bw@g To: git@vger.kernel.org - my $dbh = $rw->{over}->connect; + my $dbh = $rw->{oidx}->dbh; my ($id, $prev); - my $reidx = $rw->{over}->next_by_mid('1-bw@g', \$id, \$prev); + my $reidx = $rw->{oidx}->next_by_mid('1-bw@g', \$id, \$prev); ok(defined $reidx); my $num = $reidx->{num}; my $tid0 = $dbh->selectrow_array(<<'', undef, $num); SELECT tid FROM over WHERE num = ? LIMIT 1 - my $bytes = bytes::length($mime->as_string); + my $bytes = length($mime->as_string); my $mid = mids($mime->header_obj)->[0]; my $smsg = bless { bytes => $bytes,