diff options
author | korgoth1 <vladislav.stakhov@gmail.com> | 2020-11-15 00:36:26 +0300 |
---|---|---|
committer | korgoth1 <vladislav.stakhov@gmail.com> | 2020-11-15 00:36:26 +0300 |
commit | 9ca0016e67b27ecc69cae6dd80892b1630e2ee0e (patch) | |
tree | 769239c0e2a97e0a39571eb44979d00188e5be19 /test/lua/unit | |
parent | c7101e602f931f43b8f79a82f4616ba3b7ef3de9 (diff) | |
download | rspamd-9ca0016e67b27ecc69cae6dd80892b1630e2ee0e.tar.gz rspamd-9ca0016e67b27ecc69cae6dd80892b1630e2ee0e.zip |
[TEST] smtp date
Diffstat (limited to 'test/lua/unit')
-rw-r--r-- | test/lua/unit/smtp_date.lua | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/lua/unit/smtp_date.lua b/test/lua/unit/smtp_date.lua index 28f28497c..8fb9562a9 100644 --- a/test/lua/unit/smtp_date.lua +++ b/test/lua/unit/smtp_date.lua @@ -19,7 +19,10 @@ context("SMTP date functions", function() {'Thu, 18 May 2006 16:08:11 +0400', 1147954091}, -- obs_zone {'Sat, 26 Sep 2020 17:36:21 GMT', 1601141781}, + {'Sat, 26 Sep 2020 17:36:21 UT', 1601141781}, {'Sat, 26 Sep 2020 17:36:21 +0000', 1601141781}, + {'Wed, 30 Sep 2020 20:32:31 EDT', 1601512351}, + {'Wed, 30 Sep 2020 20:32:31 -0400', 1601512351}, {'Wed, 30 Sep 2020 17:32:31 PDT', 1601512351}, {'Wed, 30 Sep 2020 17:32:31 -0700', 1601512351}, -- 2 digit year < 50 @@ -28,10 +31,18 @@ context("SMTP date functions", function() -- 2 digit year >= 50 {'26 Aug 76 14:30 EDT', 209932200}, {'26 Aug 1976 14:30 EDT', 209932200}, + -- Year 2038 problem + {'Tue, 19 Jan 2038 03:14:09 GMT', 2^31 + 1}, -- double space before TZ {'Sat, 29 Aug 2020 08:25:15 +0700', 1598664315}, -- XXX timestamp corresponding to Sat Dec 30 00:00:00 GMT 1899 returned on error --{'Sat, Dec 30 1899 00:00:00 GMT', -2209161600}, + -- Invalid format + {'Mon Oct 5 20:29:23 BST 2020', nil}, + -- Wrong date + {'32 Jan 2020 00:00 GMT', nil}, + -- Wrong time + {'1 Jan 2020 25:00 GMT', nil} } for _,case in ipairs(cases) do |