X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Flei_store.t;h=40ad7800981318a69ef3fc351b4ea713c6039cca;hb=refs%2Fheads%2Fmaster;hp=73b5c74db0e3468cffe29dadd0054136a950c641;hpb=4d594e98063aaad1ce9a90709af7edc5c44a0163;p=public-inbox.git diff --git a/t/lei_store.t b/t/lei_store.t index 73b5c74d..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; @@ -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 ); + $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;