diff options
author | Eric Wong <e@80x24.org> | 2020-09-02 11:04:16 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2020-09-03 20:11:03 +0000 |
commit | 80b887f29b2ec71d025b4c266a1c26314758994c (patch) | |
tree | 31f9937daf20c21b33c0407763bf2d6bd06d2f66 /t/altid_v2.t | |
parent | 851aa7183cf2b152d7ff187729bc896597d22fad (diff) | |
download | public-inbox-80b887f29b2ec71d025b4c266a1c26314758994c.tar.gz |
search: replace ->query with ->mset
Nearly all of the search uses in the production code rely on a Xapian mset iterator being returned (instead of an array of $smsg objects). So default to returning the mset and move the burden of smsg array conversion into the test cases.
Diffstat (limited to 't/altid_v2.t')
-rw-r--r-- | t/altid_v2.t | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/t/altid_v2.t b/t/altid_v2.t index 01ed9ed4..f04b547b 100644 --- a/t/altid_v2.t +++ b/t/altid_v2.t @@ -41,11 +41,12 @@ hello world gmane:666 EOF $v2w->done; -my $msgs = $ibx->search->reopen->query("gmane:1234"); +my $mset = $ibx->search->reopen->mset('gmane:1234'); +my $msgs = $ibx->search->mset_to_smsg($ibx, $mset); $msgs = [ map { $_->{mid} } @$msgs ]; is_deeply($msgs, ['a@example.com'], 'got one match'); -$msgs = $ibx->search->query("gmane:666"); -is_deeply([], $msgs, 'body did NOT match'); +$mset = $ibx->search->mset('gmane:666'); +is($mset->size, 0, 'body did NOT match'); done_testing(); |