X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fv2mda.t;h=8f2f335d96b8d834cfe5ffd38df13dfc6599595a;hb=2f8d15b1170b137a0512a4f3163b236a5dcbf0b8;hp=2262c3ad60ffbd4ff1ad848eaf90286d8b5ede48;hpb=1561be76574111a53c9d7c284fd03f68d6a5208b;p=public-inbox.git diff --git a/t/v2mda.t b/t/v2mda.t index 2262c3ad..8f2f335d 100644 --- a/t/v2mda.t +++ b/t/v2mda.t @@ -1,7 +1,8 @@ -# Copyright (C) 2018-2020 all contributors +#!perl -w +# Copyright (C) all contributors # License: AGPL-3.0+ +use v5.10.1; use strict; -use warnings; use Test::More; use Fcntl qw(SEEK_SET); use Cwd; @@ -46,10 +47,6 @@ local $ENV{ORIGINAL_RECIPIENT} = 'test@example.com'; ok(run_script(['-mda'], undef, $rdr), 'mda delivered a message'); $ibx = PublicInbox::Inbox->new($ibx); - -if ($V == 1) { - ok(run_script([ '-index', "$tmpdir/inbox" ]), 'v1 indexed'); -} my $msgs = $ibx->over->recent; is(scalar(@$msgs), 1, 'only got one message'); my $eml = $ibx->smsg_eml($msgs->[0]); @@ -85,11 +82,18 @@ is($eml->as_string, $mime->as_string, 'injected message'); open my $fh, '<', $patch or die "failed to open $patch: $!\n"; $rdr->{0} = \(do { local $/; <$fh> }); ok(run_script(['-mda'], undef, $rdr), 'mda delivered a patch'); - my $post = $ibx->search->reopen->query('dfpost:6e006fd7'); - is(scalar(@$post), 1, 'got one result for dfpost'); - my $pre = $ibx->search->query('dfpre:090d998'); - is(scalar(@$pre), 1, 'got one result for dfpre'); + my $post = $ibx->search->reopen->mset('dfpost:6e006fd7'); + is($post->size, 1, 'got one result for dfpost'); + my $pre = $ibx->search->mset('dfpre:090d998'); + is($pre->size, 1, 'got one result for dfpre'); + $pre = $ibx->search->mset_to_smsg($ibx, $pre); + $post = $ibx->search->mset_to_smsg($ibx, $post); is($post->[0]->{blob}, $pre->[0]->{blob}, 'same message in both cases'); + + # git patch-id --stable search->mset("patchid:$patchid"); + is($mset->size, 1, 'patchid search works'); } done_testing();