X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fimap.t;h=0ec02818dd7dc842e63fccfeae0821ebea193352;hb=af0b0fb7a454470a32c452119d0392e0dedb3fe1;hp=0700f5788cc6bd505a420e02dbfab098fb5738fa;hpb=3d52c093ad5ce7a32f8842d9ae020712f9786352;p=public-inbox.git diff --git a/t/imap.t b/t/imap.t index 0700f578..0ec02818 100644 --- a/t/imap.t +++ b/t/imap.t @@ -1,29 +1,15 @@ #!perl -w -# Copyright (C) 2020 all contributors +# Copyright (C) 2020-2021 all contributors # License: AGPL-3.0+ # unit tests (no network) for IMAP, see t/imapd.t for end-to-end tests use strict; use Test::More; -use PublicInbox::IMAP; -use PublicInbox::IMAPD; use PublicInbox::TestCommon; -require_mods(qw(DBD::SQLite)); require_git 2.6; -use POSIX qw(strftime); - -{ - my $parse_date = \&PublicInbox::IMAP::parse_date; - is(strftime('%Y-%m-%d', gmtime($parse_date->('02-Oct-1993'))), - '1993-10-02', 'parse_date works'); - is(strftime('%Y-%m-%d', gmtime($parse_date->('2-Oct-1993'))), - '1993-10-02', 'parse_date works w/o leading zero'); - - is($parse_date->('2-10-1993'), undef, 'bad month'); - - # from what I can tell, RFC 3501 says nothing about date-month - # case-insensitivity, so be case-sensitive for now - is($parse_date->('02-oct-1993'), undef, 'case-sensitive month'); -} +require_mods(qw(DBD::SQLite Email::Address::XS||Mail::Address + Parse::RecDescent)); +require_ok 'PublicInbox::IMAP'; +require_ok 'PublicInbox::IMAPD'; my ($tmpdir, $for_destroy) = tmpdir(); my $cfgfile = "$tmpdir/config";