about summary refs log tree commit homepage
path: root/t/replace.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-09-02 11:04:16 +0000
committerEric Wong <e@80x24.org>2020-09-03 20:11:03 +0000
commit80b887f29b2ec71d025b4c266a1c26314758994c (patch)
tree31f9937daf20c21b33c0407763bf2d6bd06d2f66 /t/replace.t
parent851aa7183cf2b152d7ff187729bc896597d22fad (diff)
downloadpublic-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/replace.t')
-rw-r--r--t/replace.t8
1 files changed, 4 insertions, 4 deletions
diff --git a/t/replace.t b/t/replace.t
index c4dcb89d..a1e2d63b 100644
--- a/t/replace.t
+++ b/t/replace.t
@@ -106,8 +106,8 @@ EOF
 
         if (my $srch = $ibx->search) {
                 for my $q ('f:streisand', 's:confidential', 'malibu') {
-                        my $msgs = $srch->query($q);
-                        is_deeply($msgs, [], "no match for $q");
+                        my $mset = $srch->mset($q);
+                        is($mset->size, 0, "no match for $q");
                 }
                 my @ok = ('f:redactor', 's:redacted', 'nothing to see');
                 if ($opt->{pre}) {
@@ -119,8 +119,8 @@ EOF
                                 's:message3', 's:message4';
                 }
                 for my $q (@ok) {
-                        my $msgs = $srch->query($q);
-                        ok($msgs->[0], "got match for $q");
+                        my $mset = $srch->mset($q);
+                        ok($mset->size, "got match for $q");
                 }
         }