about summary refs log tree commit homepage
path: root/t
diff options
context:
space:
mode:
authorEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-04-05 21:45:28 +0000
committerEric Wong (Contractor, The Linux Foundation) <e@80x24.org>2018-04-06 21:18:38 +0000
commit936670cb83971bf250571a7dd9b0a0a0b33babd8 (patch)
tree675fa79206f5c1e9f3a13052ddd9d28b69fa67ca /t
parent9d6468d9560b8cd26ba2529d7a09a93ec5ad8c00 (diff)
downloadpublic-inbox-936670cb83971bf250571a7dd9b0a0a0b33babd8.tar.gz
Dscho found this useful for finding matching git commits based
on AuthorDate in git.  Add it to the overview DB format, too;
 so in the future we can support v2 repos without Xapian.

https://public-inbox.org/git/nycvar.QRO.7.76.6.1804041821420.55@ZVAVAG-6OXH6DA.rhebcr.pbec.zvpebfbsg.pbz
https://public-inbox.org/git/alpine.DEB.2.20.1702041206130.3496@virtualbox/
Diffstat (limited to 't')
-rw-r--r--t/over.t12
-rw-r--r--t/search.t7
2 files changed, 13 insertions, 6 deletions
diff --git a/t/over.t b/t/over.t
index 2a7e8d1d..c0d9d5e5 100644
--- a/t/over.t
+++ b/t/over.t
@@ -38,21 +38,21 @@ is($y, $x + 1, 'integer tid for ghost increases');
 
 my $ddd = compress('');
 foreach my $s ('', undef) {
-        $over->add_over([0, 98, [ 'a' ], [], $s, $ddd]);
-        $over->add_over([0, 99, [ 'b' ], [], $s, $ddd]);
+        $over->add_over([0, 0, 98, [ 'a' ], [], $s, $ddd]);
+        $over->add_over([0, 0, 99, [ 'b' ], [], $s, $ddd]);
         my $msgs = [ map { $_->{num} } @{$over->get_thread('a')} ];
         is_deeply([98], $msgs,
                 'messages not linked by empty subject');
 }
 
-$over->add_over([0, 98, [ 'a' ], [], 's', $ddd]);
-$over->add_over([0, 99, [ 'b' ], [], 's', $ddd]);
+$over->add_over([0, 0, 98, [ 'a' ], [], 's', $ddd]);
+$over->add_over([0, 0, 99, [ 'b' ], [], 's', $ddd]);
 foreach my $mid (qw(a b)) {
         my $msgs = [ map { $_->{num} } @{$over->get_thread('a')} ];
         is_deeply([98, 99], $msgs, 'linked messages by subject');
 }
-$over->add_over([0, 98, [ 'a' ], [], 's', $ddd]);
-$over->add_over([0, 99, [ 'b' ], ['a'], 'diff', $ddd]);
+$over->add_over([0, 0, 98, [ 'a' ], [], 's', $ddd]);
+$over->add_over([0, 0, 99, [ 'b' ], ['a'], 'diff', $ddd]);
 foreach my $mid (qw(a b)) {
         my $msgs = [ map { $_->{num} } @{$over->get_thread($mid)} ];
         is_deeply([98, 99], $msgs, "linked messages by Message-ID: <$mid>");
diff --git a/t/search.t b/t/search.t
index c9bef718..2f7b795e 100644
--- a/t/search.t
+++ b/t/search.t
@@ -170,6 +170,13 @@ sub filter_mids {
         # body
         $res = $ro->query('goodbye');
         is($res->[0]->mid, 'last@s', 'got goodbye message body');
+
+        # datestamp
+        $res = $ro->query('dt:20101002000001..20101002000001');
+        @res = filter_mids($res);
+        is_deeply(\@res, ['ghost-message@s'], 'exact Date: match works');
+        $res = $ro->query('dt:20101002000002..20101002000002');
+        is_deeply($res, [], 'exact Date: match down to the second');
 }
 
 # long message-id