X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Flei_store.t;h=5a5e5de03e16452467c07d44528dca1dacc516b3;hb=563206c94db52f7e0e6d899fef2681c9e63f8fee;hp=024ff5273aca742afd2af230538258bb4c4b4744;hpb=86f7b16ee50081d4eed779372ccc198d8a1770dc;p=public-inbox.git
diff --git a/t/lei_store.t b/t/lei_store.t
index 024ff527..5a5e5de0 100644
--- a/t/lei_store.t
+++ b/t/lei_store.t
@@ -1,5 +1,5 @@
#!perl -w
-# Copyright (C) 2020-2021 all contributors
+# Copyright (C) all contributors
# License: AGPL-3.0+
use strict;
use v5.10.1;
@@ -23,6 +23,7 @@ is($sto->add_eml($eml), undef, 'idempotent');
$sto->done;
{
my $es = $sto->search;
+ ok($es->can('isrch'), ref($es). ' can ->isrch (for SolverGit)');
my $msgs = $es->over->query_xover(0, 1000);
is(scalar(@$msgs), 1, 'one message');
is($msgs->[0]->{blob}, $smsg->{blob}, 'blob matches');
@@ -30,7 +31,8 @@ $sto->done;
is($mset->size, 1, 'search works');
is_deeply($es->mset_to_artnums($mset), [ $msgs->[0]->{num} ],
'mset_to_artnums');
- my @kw = $es->msg_keywords(($mset->items)[0]);
+ my $mi = ($mset->items)[0];
+ my @kw = PublicInbox::Search::xap_terms('K', $mi->get_document);
is_deeply(\@kw, [], 'no flags');
}
@@ -122,4 +124,32 @@ SKIP: {
'kw_changed undef on unknown message');
}
+SKIP: {
+ require_mods(qw(HTTP::Date), 1);
+ my $now = HTTP::Date::time2str(time);
+ $now =~ s/GMT/+0000/ or xbail "no GMT in $now";
+ my $eml = PublicInbox::Eml->new(<<"EOM");
+Received: (listserv\@example.com) by example.com via listexpand
+ id abcde (ORCPT );
+ $now;
+Date: $now
+Subject: timezone-dependent test
+
+WHAT IS TIME ANYMORE?
+EOM
+
+ my $smsg = $sto->add_eml($eml);
+ ok($smsg && $smsg->{blob}, 'recently received message');
+ $sto->done;
+ local $ENV{TZ} = 'GMT+5';
+ my $lse = $sto->search;
+ my $qstr = 'rt:1.hour.ago.. s:timezone';
+ $lse->query_approxidate($lse->git, $qstr);
+ my $mset = $lse->mset($qstr);
+ is($mset->size, 1, 'rt:1.hour.ago.. works w/ local time');
+}
+
+is_deeply([glob("$store_dir/local/*.git/info/refs")], [],
+ 'no info/refs in private lei/store');
+
done_testing;