summaryrefslogtreecommitdiff
path: root/mh/tests/fmtfunc.at
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2017-07-04 12:41:29 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2017-07-04 12:41:29 +0300
commit3fc6fc8ae9fe5980abf25e109c96934cb1fdb1eb (patch)
treea8e86fd4842381fe7c470b6ce0d8806bc7c07d85 /mh/tests/fmtfunc.at
parent55ce659fd9a9aa49de31d33f7937fb5966fb2e1d (diff)
downloadmailutils-3fc6fc8ae9fe5980abf25e109c96934cb1fdb1eb.tar.gz
mailutils-3fc6fc8ae9fe5980abf25e109c96934cb1fdb1eb.tar.bz2
Improve parsedate & related MH formats
* libmailutils/datetime/parsedate.y (spec production): If a non-signed number is given, treat it as a (positive) timezone, unless tz is already set, or as a year number, unless a year is already set, or throw an error otherwise. (mu_parse_date_dtl): Revert sign of the returned utc_offset * mh/mh_format.c (builtin_tzone): Compatibility fix * mh/tests/fmtfunc.at: Test more functions.
Diffstat (limited to 'mh/tests/fmtfunc.at')
-rw-r--r--mh/tests/fmtfunc.at49
1 files changed, 39 insertions, 10 deletions
diff --git a/mh/tests/fmtfunc.at b/mh/tests/fmtfunc.at
index 8f8b81c27..07be0e07d 100644
--- a/mh/tests/fmtfunc.at
+++ b/mh/tests/fmtfunc.at
@@ -464,7 +464,17 @@ FMTFUNC([weekday],
[Monday
])
-# FIXME: sday
+FMTFUNC([sday],
+[%(sday{Date})
+%(sday{X-Date})
+],
+[Date: Mon, 3 Jul 2017 13:17:58 +0300
+X-Date: 3 Jul 2017 13:17:58 +0300
+
+],
+[1
+0
+])
FMTFUNC([mday],
[%(mday{Date})
@@ -522,17 +532,36 @@ FMTFUNC([year],
# FIXME: zone
-# FIXME: This returns EEST if tz files are properly set
-# FMTFUNC([tzone],
-# [%(tzone{Date})
-# ],
-# [Date: Mon, 3 Jul 2017 13:17:58 +0300
+FMTFUNC([tzone],
+[%(tzone{Date})
+%(tzone{X-Date-1})
+%(tzone{X-Date-2})
+%(tzone{X-Date-3})
+],
+[Date: Mon, 3 Jul 2017 13:17:58 +0300
+X-Date-1: Mon, 3 Jul 2017 13:17:58 -0500
+X-Date-2: Mon, 3 Jul 2017 13:17:58 +0000
+X-Date-3: Mon, 3 Jul 2017 13:17:58 0000
-# ],
-# [+0300
-# ])
-# FIXME: szone
+],
+[+0300
+-0500
++0000
++0000
+])
+
+FMTFUNC([szone],
+[%(szone{Date})
+%(szone{X-Date})
+],
+[Date: Mon, 3 Jul 2017 13:17:58 +0300
+X-Date: Mon, 3 Jul 2017 13:17:58
+
+],
+[1
+0
+])
# FIXME: date2local

Return to:

Send suggestions and report system problems to the System administrator.