bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-stri


From: Hong Xu
Subject: bug#25086: [PATCH] Fix the timezone detection of parse-iso8601-time-string.
Date: Thu, 01 Dec 2016 22:13:27 -0800
User-agent: mu4e 0.9.17; emacs 25.1.90.2

On 2016-12-01 Thu 21:45 GMT-0800, Matt Armstrong <address@hidden> wrote:

> Hong Xu <address@hidden> writes:
>
>>  doc/misc/emacs-mime.texi    |  3 +++
>>  lisp/calendar/parse-time.el | 12 ++++++++----
>>  src/editfns.c               |  5 ++---
>>  3 files changed, 13 insertions(+), 7 deletions(-)
>
> Hi Hong, have you seen test/lisp/calendar/parse-time-tests.el?  It might
> be nice to add test coverage for parse-iso8601-time-string there.


Thanks for the reminder. A patch to add tests is attached.

Note that I've kept the two patches separate since the one without tests
should be applied to the stable branch (since it has no test), but this
patch should be applied to master.

diff --git a/test/lisp/calendar/parse-time-tests.el 
b/test/lisp/calendar/parse-time-tests.el
index 9bcf2b4a53c7..6b2b7af0694b 100644
--- a/test/lisp/calendar/parse-time-tests.el
+++ b/test/lisp/calendar/parse-time-tests.el
@@ -42,7 +42,15 @@
   (should (equal (parse-time-string "Monday, 22 february 2016 19:35:42 +0100")
                  '(42 35 19 22 2 2016 1 nil 3600)))
   (should (equal (parse-time-string "Monday, 22 february 2016 19:35:42 PDT")
-                 '(42 35 19 22 2 2016 1 t -25200))))
+                 '(42 35 19 22 2 2016 1 t -25200)))
+  (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-0200")
+                 '(13818 33666)))
+  (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-02:00")
+                 '(13818 33666)))
+  (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54-02")
+                 '(13818 33666)))
+  (should (equal (parse-iso8601-time-string "1998-09-12T12:21:54+02")
+                 '(13818 19266))))
 
 (provide 'parse-time-tests)
 

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]