]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/lei_store.t
No ext_urls
[public-inbox.git] / t / lei_store.t
index 73b5c74db0e3468cffe29dadd0054136a950c641..5a5e5de03e16452467c07d44528dca1dacc516b3 100644 (file)
@@ -1,5 +1,5 @@
 #!perl -w
-# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use v5.10.1;
@@ -124,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 <rfc822;u\@example.com>);
+       $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;