X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=blobdiff_plain;f=t%2Flei_store.t;h=c31e27a2d481b9659c198075aedd592638414544;hp=73b5c74db0e3468cffe29dadd0054136a950c641;hb=fe1b11bf5a752743167018f77e2826304ba0aa0e;hpb=23ac27869da4744aba2a67454504b7a157583df7 diff --git a/t/lei_store.t b/t/lei_store.t index 73b5c74d..c31e27a2 100644 --- a/t/lei_store.t +++ b/t/lei_store.t @@ -124,4 +124,28 @@ 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 + + ok($sto->add_eml($eml), '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'); +} + done_testing;