about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2015-08-15 09:28:33 +0000
committerEric Wong <e@80x24.org>2015-08-15 19:15:40 +0000
commit7edf30e5349ab5566815e5050e9ba0f53e1d0bb9 (patch)
treeaa46cb0560f187e197614a4530efbe23969f27d1 /t
parentd7fcdec712accc212bcfa35e50ade1233eb9beb3 (diff)
downloadpublic-inbox-7edf30e5349ab5566815e5050e9ba0f53e1d0bb9.tar.gz
This will relieve callers of the need to decode the data
we store internally in Xapian
Diffstat (limited to 't')
-rw-r--r--t/search.t11
1 files changed, 5 insertions, 6 deletions
diff --git a/t/search.t b/t/search.t
index 201578d4..9de6d286 100644
--- a/t/search.t
+++ b/t/search.t
@@ -48,7 +48,7 @@ my $ro = PublicInbox::Search->new($git_dir);
 
 sub filter_mids {
         my ($res) = @_;
-        sort(map { (split(/\n/, $_))[0] } @{$res->{msgs}});
+        sort(map { $_->mid } @{$res->{msgs}});
 }
 
 {
@@ -144,8 +144,7 @@ sub filter_mids {
 
         # body
         $res = $ro->query('goodbye');
-        is((split(/\n/, $res->{msgs}->[0]))[0], 'last@s',
-           'got goodbye message body');
+        is($res->{msgs}->[0]->mid, 'last@s', 'got goodbye message body');
 }
 
 # long message-id
@@ -226,12 +225,12 @@ sub filter_mids {
                 body => "theatre\nfade\n"));
         my $res = $rw->query("theatre");
         is($res->{count}, 2, "got both matches");
-        like($res->{msgs}->[0], qr/\Anquote\@a/, "non-quoted scores higher");
-        like($res->{msgs}->[1], qr/\Aquote\@a/, "quoted result still returned");
+        is($res->{msgs}->[0]->mid, 'nquote@a', "non-quoted scores higher");
+        is($res->{msgs}->[1]->mid, 'quote@a', "quoted result still returned");
 
         $res = $rw->query("illusions");
         is($res->{count}, 1, "got a match for quoted text");
-        like($res->{msgs}->[0], qr/\Aquote\@a/,
+        is($res->{msgs}->[0]->mid, 'quote@a',
                 "quoted result returned if nothing else");
 }